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 () {
|
function () {
|
||||||
localStorage.removeItem('password');
|
localStorage.removeItem('password');
|
||||||
localStorage.removeItem('username');
|
localStorage.removeItem('username');
|
||||||
|
localStorage.removeItem('lastsync');
|
||||||
restartApplication();
|
restartApplication();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -8,8 +8,13 @@
|
|||||||
function gatherSyncData() {
|
function gatherSyncData() {
|
||||||
var data = {
|
var data = {
|
||||||
localStorage: {},
|
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();
|
var allitems = getAllStorage();
|
||||||
for (var i = 0; i < allitems.length; i++) {
|
for (var i = 0; i < allitems.length; i++) {
|
||||||
var key = allitems[i].key;
|
var key = allitems[i].key;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user