fixed: do not override local data if remote data is empty
This commit is contained in:
parent
37eed8736f
commit
afd3aeab37
1 changed files with 5 additions and 2 deletions
7
main.js
7
main.js
|
|
@ -1283,8 +1283,11 @@ function init()
|
|||
queryremote({action: "fetch"})
|
||||
.then(data =>
|
||||
{
|
||||
window.localStorage.setItem("data", JSON.stringify(data));
|
||||
loadstorage();
|
||||
if (data.length)
|
||||
{
|
||||
window.localStorage.setItem("data", JSON.stringify(data));
|
||||
loadstorage();
|
||||
}
|
||||
})
|
||||
.catch(err =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue