diff --git a/packages/presentation/src/utils.ts b/packages/presentation/src/utils.ts
index 19b531f670..49e3d89691 100644
--- a/packages/presentation/src/utils.ts
+++ b/packages/presentation/src/utils.ts
@@ -743,7 +743,14 @@ export function isCollabAttr (hierarchy: Hierarchy, key: KeyedAttribute): boolea
*/
export function decodeTokenPayload (token: string): any {
try {
- return JSON.parse(atob(token.split('.')[1]))
+ if (token === '') {
+ return {}
+ }
+ const tsplit = token.split('.')
+ if (tsplit.length < 2) {
+ return {}
+ }
+ return JSON.parse(atob(tsplit[1]))
} catch (err: any) {
console.error(err)
return {}
diff --git a/packages/ui/src/location.ts b/packages/ui/src/location.ts
index 17bcedbbfc..3633784509 100644
--- a/packages/ui/src/location.ts
+++ b/packages/ui/src/location.ts
@@ -234,6 +234,10 @@ export const setTreeCollapsed = (_id: any, collapsed: boolean, prefix?: string):
collapsed ? localStorage.setItem(key, COLLAPSED) : localStorage.removeItem(key)
}
+export function isSameSegments (a: PlatformLocation, b: PlatformLocation, len = 2): boolean {
+ return a.path.slice(0, len).every((segment, index) => segment === b.path[index])
+}
+
export function restoreLocation (loc: PlatformLocation, app: Plugin): void {
const last = localStorage.getItem(`${locationStorageKeyId}_${app}`)
diff --git a/plugins/guest-resources/src/components/Guest.svelte b/plugins/guest-resources/src/components/Guest.svelte
index 2d7f85a9fb..db6808a067 100644
--- a/plugins/guest-resources/src/components/Guest.svelte
+++ b/plugins/guest-resources/src/components/Guest.svelte
@@ -26,25 +26,22 @@
Popup,
PopupAlignment,
ResolvedLocation,
- Separator,
TooltipInstance,
areLocationsEqual,
closePanel,
- getCurrentLocation,
- getLocation,
- navigate,
- showPanel,
defineSeparators,
+ deviceOptionsStore as deviceInfo,
+ getCurrentLocation,
setResolvedLocation,
- deviceOptionsStore as deviceInfo
+ showPanel
} from '@hcengineering/ui'
import view from '@hcengineering/view'
import { ListSelectionProvider, parseLinkId, restrictionStore, updateFocus } from '@hcengineering/view-resources'
import workbench, { Application, NavigatorModel, SpecialNavModel, ViewConfiguration } from '@hcengineering/workbench'
import { SpaceView, buildNavModel } from '@hcengineering/workbench-resources'
+ import { workbenchGuestSeparators } from '..'
import guest from '../plugin'
import { checkAccess } from '../utils'
- import { workbenchGuestSeparators } from '..'
const excludedApps = getMetadata(workbench.metadata.ExcludedApplications) ?? []
$deviceInfo.navigator.visible = false
diff --git a/plugins/guest-resources/src/components/GuestApp.svelte b/plugins/guest-resources/src/components/GuestApp.svelte
index f4b71de44a..e055e45464 100644
--- a/plugins/guest-resources/src/components/GuestApp.svelte
+++ b/plugins/guest-resources/src/components/GuestApp.svelte
@@ -16,18 +16,24 @@
import { getMetadata } from '@hcengineering/platform'
import { Label, Loading, Notifications, location } from '@hcengineering/ui'
import { upgradeDownloadProgress } from '@hcengineering/presentation'
- import { connect, versionError } from '../connect'
+ import { connect, versionError, invalidError } from '../connect'
import { guestId } from '@hcengineering/guest'
import workbench from '@hcengineering/workbench'
import Guest from './Guest.svelte'
+ import plugin from '../plugin'
{#if $location.path[0] === guestId}
{#await connect(getMetadata(workbench.metadata.PlatformTitle) ?? 'Platform')}