🐛 (sync) init sync if online
This commit is contained in:
@@ -50,7 +50,12 @@ class CouchService {
|
|||||||
this.cancelSync()
|
this.cancelSync()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (navigator.onLine) {
|
||||||
|
this.initLive()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async initLive(): Promise<boolean> {
|
public async initLive(): Promise<boolean> {
|
||||||
if (!this.db) {
|
if (!this.db) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class QueueNotifService {
|
|||||||
this.queue.push(notif)
|
this.queue.push(notif)
|
||||||
if (this.callback) {
|
if (this.callback) {
|
||||||
this.queue.forEach(this.callback)
|
this.queue.forEach(this.callback)
|
||||||
|
this.queue = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user