SimpleChat:ODS: Add a prefix to chatid wrt ondiskstorage key

This commit is contained in:
HanishKVC 2024-05-31 00:20:38 +05:30
parent e2efcb4fc2
commit a15d4dc6a2

View file

@ -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;
} }