From 5e3c82feded6de6475cc7e22c3f67537c2dbb18e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Jan 2018 18:52:19 +0100 Subject: [PATCH] fix undefined in content --- src/app/files/shared-folder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/files/shared-folder.js b/src/app/files/shared-folder.js index 689737e392..dc424f0bd8 100644 --- a/src/app/files/shared-folder.js +++ b/src/app/files/shared-folder.js @@ -55,6 +55,7 @@ module.exports = class SharedFolder { this.type = 'localhost' this.error = { 'EEXIST': 'File already exists' } this._isReady = true + this.filesContent = {} remixd.event.register('notified', (data) => { if (data.scope === 'sharedfolder') { @@ -117,10 +118,10 @@ module.exports = class SharedFolder { get (path, cb) { var unprefixedpath = this.removePrefix(path) - this._remixd.call('sharedfolder', 'get', {path: unprefixedpath}, (error, content) => { + this._remixd.call('sharedfolder', 'get', {path: unprefixedpath}, (error, file) => { if (!error) { - this.filesContent[path] = content - cb(error, content) + this.filesContent[path] = file.content + cb(error, file.content) } else { // display the last known content. // TODO should perhaps better warn the user that the file is not synced. @@ -134,7 +135,6 @@ module.exports = class SharedFolder { this._remixd.call('sharedfolder', 'set', {path: unprefixedpath, content: content}, (error, result) => { if (cb) cb(error, result) var path = this.type + '/' + unprefixedpath - this.filesContent[path] this.event.trigger('fileChanged', [path]) }) return true