implemented feedback
This commit is contained in:
parent
7c6b73efdb
commit
e5a196a42b
9 changed files with 31 additions and 35 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue