fixed: do not override local data if remote data is empty
This commit is contained in:
parent
37eed8736f
commit
afd3aeab37
3
main.js
3
main.js
|
@ -1282,9 +1282,12 @@ function init()
|
||||||
{
|
{
|
||||||
queryremote({action: "fetch"})
|
queryremote({action: "fetch"})
|
||||||
.then(data =>
|
.then(data =>
|
||||||
|
{
|
||||||
|
if (data.length)
|
||||||
{
|
{
|
||||||
window.localStorage.setItem("data", JSON.stringify(data));
|
window.localStorage.setItem("data", JSON.stringify(data));
|
||||||
loadstorage();
|
loadstorage();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(err =>
|
.catch(err =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue