fix: ask updated dbLoadTodo (if something to process) only when is connected...

This commit is contained in:
Paolo Arena
2019-02-15 14:54:56 +01:00
parent fac16d2d52
commit ffe3fce52b
4 changed files with 14 additions and 10 deletions

View File

@@ -128,7 +128,6 @@ namespace Actions {
let promiseChain = Promise.resolve()
something = true
for (let rec of arr_recmsg) {
// console.log(' .... sw.sync.register ( ', rec._id)
// if ('SyncManager' in window) {
@@ -138,6 +137,9 @@ namespace Actions {
// #Alternative to SyncManager
promiseChain = promiseChain.then(() => {
return Api.syncAlternative(rec._id)
.then(() => {
something = true
})
})
// }
@@ -166,6 +168,7 @@ namespace Actions {
return sendSwMsgIfAvailable()
.then(something => {
if (something) {
console.log('something')
// Refresh data
return waitAndRefreshData(context)
}