Exemplo n.º 1
0
 return delay(120000).then(function () {
     if (!_this._appAlive(appName)) {
         return;
     }
     if (_.get(_this._refCounter, appName) === 0) {
         delete _this._refCounter[appName];
         return firebase.app(appName).delete().catch(_.noop);
     }
 });
Exemplo n.º 2
0
 Apps.prototype._appAlive = function (appName) {
     try {
         var app = firebase.app(appName);
         return !_.get(app, 'isDeleted_');
     }
     catch (e) {
         return false;
     }
 };
Exemplo n.º 3
0
 get: function () {
     if (this._appAlive('__noauth__')) {
         return firebase.app('__noauth__');
     }
     var param = _.extend({}, this.firebaseArgs, {
         databaseAuthVariableOverride: null,
     });
     return firebase.initializeApp(param, '__noauth__');
 },
Exemplo n.º 4
0
 Apps.prototype.forMode = function (auth) {
     if (typeof auth !== 'object') {
         return this.noauth;
     }
     if (auth.admin) {
         return this.admin;
     }
     if (!auth.variable) {
         return this.noauth;
     }
     var appName = this._appName(auth);
     if (this._appAlive(appName)) {
         return firebase.app(appName);
     }
     var param = _.extend({}, this.firebaseArgs, {
         databaseAuthVariableOverride: auth.variable,
     });
     return firebase.initializeApp(param, appName);
 };
Exemplo n.º 5
0
 get: function () {
     if (this._appAlive('__admin__')) {
         return firebase.app('__admin__');
     }
     return firebase.initializeApp(this.firebaseArgs, '__admin__');
 },