fixed sloppy coding whenrefering to storage instead of this.storage in storage nodes

This commit is contained in:
Peter Svensson
2020-04-23 12:58:55 +02:00
parent 186b402d07
commit c7941c2647
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-firebase-admin", "name": "node-red-contrib-firebase-admin",
"version": "1.1.18", "version": "1.1.19",
"description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.", "description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -27,7 +27,7 @@ module.exports = function(RED) {
if(msg && msg.payload){ if(msg && msg.payload){
let path = msg.payload.path || msg.path || this.path let path = msg.payload.path || msg.path || this.path
let bucket = msg.payload.bucket || msg.bucket || this.bucket let bucket = msg.payload.bucket || msg.bucket || this.bucket
console.log('------------------------------ storage-read reading from bucket "'+bucket+'" path "'+path+'" this.storage = '+this.storage+' storage = '+storage) console.log('------------------------------ storage-read reading from bucket "'+bucket+'" path "'+path+'" this.storage = '+this.storage)
if(msg.payload.files && msg.payload.files.length > 0){ if(msg.payload.files && msg.payload.files.length > 0){
console.log('--reading from files') console.log('--reading from files')
let count = msg.payload.files.length let count = msg.payload.files.length
@ -54,7 +54,7 @@ module.exports = function(RED) {
} else if(msg){ } else if(msg){
console.log('* reading single file from path '+path) console.log('* reading single file from path '+path)
try{ try{
let s = this.storage || storage let s = this.storage
s.bucket(bucket) s.bucket(bucket)
.file(path).download().then((file)=>{ .file(path).download().then((file)=>{
console.log('storage-read got file') console.log('storage-read got file')