Skip to content

Commit 31f7b4f

Browse files
committed
#236-update-url
1 parent 63e837c commit 31f7b4f

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

data-browser/src/components/SideBar/DriveSwitcher.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { classes, Resource, urls, useResources } from '@tomic/react';
1+
import {
2+
classes,
3+
Resource,
4+
truncateUrl,
5+
urls,
6+
useResources,
7+
} from '@tomic/react';
28
import React, { useMemo } from 'react';
39
import {
410
FaCog,
@@ -21,7 +27,8 @@ const Trigger = buildDefaultTrigger(<FaHdd />, 'Open Drive Settings');
2127

2228
function getTitle(resource: Resource): string {
2329
return (
24-
(resource.get(urls.properties.name) as string) ?? resource.getSubject()
30+
(resource.get(urls.properties.name) as string) ??
31+
truncateUrl(resource.getSubject(), 20)
2532
);
2633
}
2734

data-browser/src/hooks/useSavedDrives.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { isDev } from '../config';
44
import { useSettings } from '../helpers/AppSettings';
55

66
const rootDrives = [
7-
window.location.origin,
8-
'https://atomicdata.dev',
9-
...(isDev() ? ['http://localhost:9883'] : []),
7+
window.location.origin + '/',
8+
'https://atomicdata.dev/',
9+
...(isDev() ? ['http://localhost:9883/'] : []),
1010
];
1111

1212
const arrayOpts = {

data-browser/src/routes/Routes.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import ResourcePage from '../views/ResourcePage';
1818
import { ShareRoute } from './ShareRoute';
1919
import { Sandbox } from './Sandbox';
2020

21-
const homeURL = window.location.origin;
21+
/** Server URLs should have a `/` at the end */
22+
const homeURL = window.location.origin + '/';
2223

2324
const isDev = import.meta.env.MODE === 'development';
2425

lib/src/authentication.ts

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export async function signRequest(
5858
agent: Agent,
5959
headers: HeadersObject | Headers,
6060
): Promise<HeadersObject> {
61+
console.log('sign request', subject);
6162
const timestamp = getTimestampNow();
6263

6364
if (agent?.subject && !localTryingExternal(subject, agent)) {

0 commit comments

Comments
 (0)