diff --git a/src/services/CouchService.ts b/src/services/CouchService.ts index 6ca79e1..d470d96 100644 --- a/src/services/CouchService.ts +++ b/src/services/CouchService.ts @@ -50,7 +50,12 @@ class CouchService { this.cancelSync() }) } + + if (navigator.onLine) { + this.initLive() + } } + public async initLive(): Promise { if (!this.db) { return false diff --git a/src/services/QueueNotifService.ts b/src/services/QueueNotifService.ts index 09a2eaf..d16c1cb 100644 --- a/src/services/QueueNotifService.ts +++ b/src/services/QueueNotifService.ts @@ -54,6 +54,7 @@ class QueueNotifService { this.queue.push(notif) if (this.callback) { this.queue.forEach(this.callback) + this.queue = [] } } }