From 804ef772c023ba1abe61c8e2f958a855071c5512 Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Tue, 27 Mar 2018 16:33:51 +0100 Subject: [PATCH] [database] Fix issue with server time offset #910 --- lib/modules/database/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/database/index.js b/lib/modules/database/index.js index fb198588..e36ac69b 100644 --- a/lib/modules/database/index.js +++ b/lib/modules/database/index.js @@ -52,6 +52,7 @@ export default class Database extends ModuleBase { serviceUrl ); + this._serverTimeOffset = 0; this._serviceUrl = serviceUrl; this._transactionHandler = new TransactionHandler(this); @@ -64,7 +65,6 @@ export default class Database extends ModuleBase { // todo move this and persistence to native side, create a db configure() method natively perhaps? // todo and then native can call setPersistence and then emit offset events setTimeout(() => { - this._serverTimeOffset = 0; this._offsetRef = this.ref('.info/serverTimeOffset'); this._offsetRef.on('value', snapshot => { this._serverTimeOffset = snapshot.val() || this._serverTimeOffset;