Fix issue where a new client will overwrite the server-stored settings on first sync
This commit is contained in:
parent
a93d33d18d
commit
756e1e327a
@ -12,6 +12,7 @@ function logout() {
|
||||
function () {
|
||||
localStorage.removeItem('password');
|
||||
localStorage.removeItem('username');
|
||||
localStorage.removeItem('lastsync');
|
||||
restartApplication();
|
||||
}
|
||||
);
|
||||
|
@ -8,8 +8,13 @@
|
||||
function gatherSyncData() {
|
||||
var data = {
|
||||
localStorage: {},
|
||||
changed: getStorage("lastchange") == null ? 0 : getStorage("lastchange")
|
||||
changed: getStorage("lastchange") == null ? 0 : getStorage("lastchange"),
|
||||
};
|
||||
if (!inStorage("lastsync")) {
|
||||
// first time syncing to the server, let's make sure
|
||||
// the server settings take precedence
|
||||
data.changed = 1;
|
||||
}
|
||||
var allitems = getAllStorage();
|
||||
for (var i = 0; i < allitems.length; i++) {
|
||||
var key = allitems[i].key;
|
||||
|
Loading…
x
Reference in New Issue
Block a user