fix: fix app crash
this commit fixes a crash due to unavailability of localStorage https://github.com/zyachel/libremdb/issues/31
This commit is contained in:
@ -103,3 +103,13 @@ export const getResTitleTypeHeading = (
|
||||
if (el.id === titleType) return el.name;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const isLocalStorageAvailable = () => {
|
||||
try {
|
||||
localStorage.getItem('test');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user