aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/local_storage
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-05-30 06:49:13 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-05-30 06:49:13 +0800
commitbc28a08dd0d4db99549122fb4912b4931a3aad78 (patch)
treeba94822b58608f7c5cf22c0130adb76574de4dd5 /packages/website/ts/local_storage
parent0d3010f6fc8b14011444f090dfbd0221411a1ab0 (diff)
downloaddexon-0x-contracts-bc28a08dd0d4db99549122fb4912b4931a3aad78.tar.gz
dexon-0x-contracts-bc28a08dd0d4db99549122fb4912b4931a3aad78.tar.zst
dexon-0x-contracts-bc28a08dd0d4db99549122fb4912b4931a3aad78.zip
Address PR feedback
Diffstat (limited to 'packages/website/ts/local_storage')
-rw-r--r--packages/website/ts/local_storage/local_storage.ts8
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;
},