[menu] fix json.parse on missing auth in localstorage

This commit is contained in:
nymkappa
2023-08-20 08:11:55 +02:00
parent c4f2f4ca66
commit b64b6fb3c7
4 changed files with 23 additions and 9 deletions

View File

@@ -56,4 +56,12 @@ export class StorageService {
console.log(e);
}
}
getAuth(): any | null {
try {
return JSON.parse(localStorage.getItem('auth'));
} catch(e) {
return null;
}
}
}