From d65cb706529801b3dde2d5b276a5061a3d561ccd Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Tue, 21 Mar 2023 16:58:23 +0500 Subject: [PATCH] TSK-811: Fix for undefined when saving platform last location (#2790) Signed-off-by: Vyacheslav Tumanov --- packages/ui/src/location.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/location.ts b/packages/ui/src/location.ts index f0533ad8e6..c893be3407 100644 --- a/packages/ui/src/location.ts +++ b/packages/ui/src/location.ts @@ -115,7 +115,9 @@ export function navigate (location: PlatformLocation, store = true): void { if (store) { history.pushState(null, '', url) localStorage.setItem('platform_last_loc', JSON.stringify(location)) - localStorage.setItem(`platform_last_loc_${location.path[1]}`, JSON.stringify(location)) + if (location.path[1] !== undefined) { + localStorage.setItem(`platform_last_loc_${location.path[1]}`, JSON.stringify(location)) + } } locationWritable.set(location) }