[database] Fix issue with server time offset #910

This commit is contained in:
Chris Bianca 2018-03-27 16:33:51 +01:00
parent 9f9a3da5af
commit 804ef772c0
1 changed files with 1 additions and 1 deletions

View File

@ -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;