projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add unambiguous section in the PGN + some fixes + code formatting and fix typos
[vchess.git]
/
client
/
src
/
utils
/
gameStorage.js
diff --git
a/client/src/utils/gameStorage.js
b/client/src/utils/gameStorage.js
index
514448b
..
62ad1fa
100644
(file)
--- a/
client/src/utils/gameStorage.js
+++ b/
client/src/utils/gameStorage.js
@@
-19,10
+19,11
@@
import { store } from "@/store";
function dbOperation(callback) {
let db = null;
function dbOperation(callback) {
let db = null;
- let DBOpenRequest = window.indexedDB.open("vchess",
4
);
+ let DBOpenRequest = window.indexedDB.open("vchess",
5
);
DBOpenRequest.onerror = function(event) {
DBOpenRequest.onerror = function(event) {
- alert(store.state.tr["Database error: stop private browsing, or update your browser"]);
+ alert(store.state.tr[
+ "Database error: stop private browsing, or update your browser"]);
callback("error", null);
};
callback("error", null);
};
@@
-85,6
+86,8
@@
export const GameStorage = {
if (obj.moveIdx < game.moves.length) return;
Object.keys(obj).forEach(k => {
if (k == "move") game.moves.push(obj[k]);
if (obj.moveIdx < game.moves.length) return;
Object.keys(obj).forEach(k => {
if (k == "move") game.moves.push(obj[k]);
+ else if (k == "chat") game.chats.push(obj[k]);
+ else if (k == "delchat") game.chats = [];
else game[k] = obj[k];
});
objectStore.put(game); //save updated data
else game[k] = obj[k];
});
objectStore.put(game); //save updated data