X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fstore.js;h=792d2a5b2a7f3eb59ab94cdbab327eba28545ca3;hb=d9a7a1e40254bda6e545514596a7363048c084f9;hp=8fe46b90801b44837251c08ddc14c4027bf781b9;hpb=31ccd7e3ef9bf4ebc69231527f78e24668631194;p=vchess.git diff --git a/client/src/store.js b/client/src/store.js index 8fe46b90..792d2a5b 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -31,7 +31,6 @@ export const store = { return; } this.state.variants = json.variantArray - .filter(v => v.name != "Eightpieces") //TODO: not ready yet .sort((v1,v2) => v1.name.localeCompare(v2.name)); }); let mysid = localStorage.getItem("mysid"); @@ -46,6 +45,7 @@ export const store = { name: localStorage.getItem("myname") || "", //"" for "anonymous" email: "", //unknown yet notify: false, //email notifications + newsRead: localStorage.getItem("newsRead") || 0, sid: mysid }; // Slow verification through the server: @@ -78,6 +78,8 @@ export const store = { localStorage.removeItem("myname"); this.state.user.email = json.email; this.state.user.notify = json.notify; + if (!!json.newsRead && json.newsRead > this.state.user.newsRead) + this.state.user.newsRead = json.newsRead; }); // Settings initialized with values from localStorage const getItemDefaultTrue = (item) => {