SimpleChat:ODS: Add a prefix to chatid wrt ondiskstorage key
This commit is contained in:
parent
e2efcb4fc2
commit
a15d4dc6a2
1 changed files with 6 additions and 2 deletions
|
@ -78,14 +78,18 @@ class SimpleChat {
|
||||||
this.iLastSys = -1;
|
this.iLastSys = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ods_key() {
|
||||||
|
return `SimpleChat-${this.chatId}`
|
||||||
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
/** @type {SimpleChatODS} */
|
/** @type {SimpleChatODS} */
|
||||||
let ods = {iLastSys: this.iLastSys, xchat: this.xchat};
|
let ods = {iLastSys: this.iLastSys, xchat: this.xchat};
|
||||||
localStorage.setItem(this.chatId, JSON.stringify(ods));
|
localStorage.setItem(this.ods_key(), JSON.stringify(ods));
|
||||||
}
|
}
|
||||||
|
|
||||||
load() {
|
load() {
|
||||||
let sods = localStorage.getItem(this.chatId);
|
let sods = localStorage.getItem(this.ods_key());
|
||||||
if (sods == null) {
|
if (sods == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue