diff options
Diffstat (limited to 'packages/website/ts/local_storage')
-rw-r--r-- | packages/website/ts/local_storage/local_storage.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/packages/website/ts/local_storage/local_storage.ts b/packages/website/ts/local_storage/local_storage.ts index 569e262fc..1e3258ce0 100644 --- a/packages/website/ts/local_storage/local_storage.ts +++ b/packages/website/ts/local_storage/local_storage.ts @@ -26,14 +26,10 @@ export const localStorage = { } window.localStorage.removeItem(key); }, - getObject(key: string): object { + getObject(key: string): object | undefined { const item = localStorage.getItemIfExists(key); if (item) { - try { - return JSON.parse(item); - } catch (err) { - return undefined; - } + return JSON.parse(item); } return undefined; }, |