From b047d9818980ce712bb68883fbbcfec0510e54fc Mon Sep 17 00:00:00 2001 From: Anna No Date: Wed, 15 Jun 2022 14:31:41 +0700 Subject: [PATCH] TSK-112: Fix workbench switch (#2074) Signed-off-by: Anna No --- .../src/components/Workbench.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index b9a1173d65..b8735543ae 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -129,9 +129,9 @@ ) async function syncLoc (loc: Location): Promise { - const app = loc.path.length > 0 ? (loc.path[1] as Ref) : undefined - let space = loc.path.length > 1 ? (loc.path[2] as Ref) : undefined - let special = loc.path.length > 2 ? loc.path[3] : undefined + const app = loc.path.length > 1 ? (loc.path[1] as Ref) : undefined + let space = loc.path.length > 2 ? (loc.path[2] as Ref) : undefined + let special = loc.path.length > 3 ? loc.path[3] : undefined if (currentApp !== app) { clear(1) @@ -141,7 +141,7 @@ } if (space === undefined) { - const last = localStorage.getItem(`platform_last_loc_${currentApp}`) + const last = localStorage.getItem(`platform_last_loc_${app}`) if (last !== null) { const newLocation: Location = JSON.parse(last) loc.path[2] = space = newLocation.path[2] as Ref @@ -161,7 +161,7 @@ } } if (app !== undefined) { - localStorage.setItem(`platform_last_loc_${currentApp}`, JSON.stringify(loc)) + localStorage.setItem(`platform_last_loc_${app}`, JSON.stringify(loc)) } }