implemented feedback

This commit is contained in:
Johannes Berthel 2021-04-06 18:54:45 +02:00
parent 7c6b73efdb
commit e5a196a42b
9 changed files with 31 additions and 35 deletions

View file

@ -52,7 +52,13 @@ class LocalUserStore {
return localStorage.setItem(companionKey, JSON.stringify(companion));
}
getCompanion(): string|null {
return JSON.parse(localStorage.getItem(companionKey) || "null");
const companion = JSON.parse(localStorage.getItem(companionKey) || "null");
if (typeof companion !== "string" || companion === "") {
return null;
}
return companion;
}
wasCompanionSet(): boolean {
return localStorage.getItem(companionKey) ? true : false;