diff --git a/firebase-config.js b/firebase-config.js index d0a5aa3..34b725d 100644 --- a/firebase-config.js +++ b/firebase-config.js @@ -2,7 +2,7 @@ const _admin = require('firebase-admin') const {Storage} = require('@google-cloud/storage'); let global = this.context().global -let init = (global.get('firebase') !== undefined) +let init = !(_admin.apps.length === 0) let s module.exports = function(RED) { diff --git a/package.json b/package.json index 682e733..cec90b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-firebase-admin", - "version": "1.1.7", + "version": "1.1.8", "description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.", "main": "index.js", "scripts": {