diff --git a/data-browser/src/components/SideBar/DriveSwitcher.tsx b/data-browser/src/components/SideBar/DriveSwitcher.tsx index 9841a7c46..65be1b77b 100644 --- a/data-browser/src/components/SideBar/DriveSwitcher.tsx +++ b/data-browser/src/components/SideBar/DriveSwitcher.tsx @@ -1,4 +1,10 @@ -import { classes, Resource, urls, useResources } from '@tomic/react'; +import { + classes, + Resource, + truncateUrl, + urls, + useResources, +} from '@tomic/react'; import React, { useMemo } from 'react'; import { FaCog, @@ -26,7 +32,8 @@ const Trigger = buildDefaultTrigger( function getTitle(resource: Resource): string { return ( - (resource.get(urls.properties.name) as string) ?? resource.getSubject() + (resource.get(urls.properties.name) as string) ?? + truncateUrl(resource.getSubject(), 20) ); } diff --git a/data-browser/src/routes/Routes.tsx b/data-browser/src/routes/Routes.tsx index 46c74c717..f552e53ce 100644 --- a/data-browser/src/routes/Routes.tsx +++ b/data-browser/src/routes/Routes.tsx @@ -18,7 +18,8 @@ import ResourcePage from '../views/ResourcePage'; import { ShareRoute } from './ShareRoute'; import { Sandbox } from './Sandbox'; -const homeURL = window.location.origin; +/** Server URLs should have a `/` at the end */ +const homeURL = window.location.origin + '/'; const isDev = import.meta.env.MODE === 'development'; diff --git a/data-browser/src/routes/SearchRoute.tsx b/data-browser/src/routes/SearchRoute.tsx index 194a31cac..eec0afd02 100644 --- a/data-browser/src/routes/SearchRoute.tsx +++ b/data-browser/src/routes/SearchRoute.tsx @@ -74,8 +74,9 @@ export function Search(): JSX.Element { return ( - {error && {error.message}} - {query?.length !== 0 && results.length !== 0 ? ( + {error ? ( + {error.message} + ) : query?.length !== 0 && results.length !== 0 ? ( <> {results.map((subject, index) => ( { + console.log('sign request', subject); const timestamp = getTimestampNow(); if (agent?.subject && !localTryingExternal(subject, agent)) {