Allows to read and write "Player properties" from LocalStorage
This commit is contained in:
parent
68431c5242
commit
e025c1dc8e
5 changed files with 59 additions and 2 deletions
|
@ -22,8 +22,8 @@ const nonce = "nonce";
|
|||
const notification = "notificationPermission";
|
||||
const code = "code";
|
||||
const cameraSetup = "cameraSetup";
|
||||
|
||||
const cacheAPIIndex = "workavdenture-cache";
|
||||
const userProperties = "user-properties";
|
||||
|
||||
class LocalUserStore {
|
||||
saveUser(localUser: LocalUser) {
|
||||
|
@ -220,6 +220,13 @@ class LocalUserStore {
|
|||
const cameraSetupValues = localStorage.getItem(cameraSetup);
|
||||
return cameraSetupValues != undefined ? JSON.parse(cameraSetupValues) : undefined;
|
||||
}
|
||||
getUserProperty(name: string): string | null {
|
||||
return localStorage.getItem(userProperties + "_" + name);
|
||||
}
|
||||
|
||||
setUserProperty(name: string, value: string): void {
|
||||
localStorage.setItem(userProperties + "_" + name, value);
|
||||
}
|
||||
}
|
||||
|
||||
export const localUserStore = new LocalUserStore();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue