Skip to content

Commit 97730e7

Browse files
committed
SimpleChat:ODS: Add a prefix to chatid wrt ondiskstorage key
1 parent 3e1a27d commit 97730e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/server/public_simplechat/simplechat.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,18 @@ class SimpleChat {
7878
this.iLastSys = -1;
7979
}
8080

81+
ods_key() {
82+
return `SimpleChat-${this.chatId}`
83+
}
84+
8185
save() {
8286
/** @type {SimpleChatODS} */
8387
let ods = {iLastSys: this.iLastSys, xchat: this.xchat};
84-
localStorage.setItem(this.chatId, JSON.stringify(ods));
88+
localStorage.setItem(this.ods_key(), JSON.stringify(ods));
8589
}
8690

8791
load() {
88-
let sods = localStorage.getItem(this.chatId);
92+
let sods = localStorage.getItem(this.ods_key());
8993
if (sods == null) {
9094
return;
9195
}

0 commit comments

Comments
 (0)