adding guard for other components already initalized firebase-admin

This commit is contained in:
Peter Svensson
2019-07-16 09:54:11 +02:00
parent e43f270257
commit 3b0931fde2
2 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
const _admin = require('firebase-admin')
const {Storage} = require('@google-cloud/storage');
let init = false
let global = this.context().global
let init = (global.get('firebase') !== undefined)
let s
module.exports = function(RED) {
@ -28,7 +28,7 @@ module.exports = function(RED) {
credential: credobj,
databaseURL: this.dburl
});
let global = this.context().global
global.set('firebase', _admin)
console.log('setting storage....')