From 4ab98c1f6e344b0da450e11782f64adb278f1cb8 Mon Sep 17 00:00:00 2001 From: Francisco Saldana Date: Tue, 3 Jan 2017 22:26:20 -0600 Subject: [PATCH] Add support for firestack.ServerValue.TIMESTAMP --- lib/firestack.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/firestack.js b/lib/firestack.js index 947077a..a645ef8 100644 --- a/lib/firestack.js +++ b/lib/firestack.js @@ -64,6 +64,14 @@ export default class Firestack extends Singleton { if (instance.options.errorOnMissingPlayServices && !this.googleApiAvailability.isAvailable) { throw new Error(`Google Play Services is required to run this application but no valid installation was found (Code ${this.googleApiAvailability.status}).`); } + + const database = { + ServerValue: { + TIMESTAMP: FirestackModule.serverValueTimestamp || { '.sv': 'timestamp' }, + } + }; + database.__proto__ = instance.database.__proto__; + instance.database.__proto__ = database; } _db: ?Object;