X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fstore.js;fp=client%2Fsrc%2Fstore.js;h=792d2a5b2a7f3eb59ab94cdbab327eba28545ca3;hb=d9a7a1e40254bda6e545514596a7363048c084f9;hp=76210ee32060410be09285a655f7b53e5a4d4be6;hpb=afd717788f50f92a5df6e5f1004354ff9ab0079d;p=vchess.git diff --git a/client/src/store.js b/client/src/store.js index 76210ee3..792d2a5b 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -45,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: @@ -77,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) => {