From 098b6f0d1139f1942eb0b32ece444e76cbf69723 Mon Sep 17 00:00:00 2001 From: serapath Date: Tue, 9 Jan 2018 00:45:42 +0800 Subject: [PATCH] remove unnecessary init() calls --- src/app/files/browser-files.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/app/files/browser-files.js b/src/app/files/browser-files.js index 2859c69c9d..de26e56fee 100644 --- a/src/app/files/browser-files.js +++ b/src/app/files/browser-files.js @@ -17,7 +17,7 @@ function Files (storage) { } this.init = function (cb) { - this.resolveDirectory('', (error, filesTree) => cb && cb(error)) + cb() } this.get = function (path, cb) { @@ -47,7 +47,6 @@ function Files (storage) { return false } if (!exists) { - this.init() event.trigger('fileAdded', [this.type + '/' + unprefixedpath, false]) } else { event.trigger('fileChanged', [this.type + '/' + unprefixedpath]) @@ -62,7 +61,6 @@ function Files (storage) { var unprefixedpath = this.removePrefix(path) if (!storage.exists(unprefixedpath)) { readonly[unprefixedpath] = content - this.init() event.trigger('fileAdded', [this.type + '/' + unprefixedpath, true]) return true } @@ -88,7 +86,6 @@ function Files (storage) { return false } } - this.init() event.trigger('fileRemoved', [this.type + '/' + unprefixedpath]) return true } @@ -100,7 +97,6 @@ function Files (storage) { if (!storage.rename(unprefixedoldPath, unprefixednewPath)) { return false } - this.init() event.trigger('fileRenamed', [this.type + '/' + unprefixedoldPath, this.type + '/' + unprefixednewPath, isFolder]) return true } @@ -168,8 +164,6 @@ function Files (storage) { if (this.exists('.browser-solidity.json')) { this.rename('.browser-solidity.json', '.remix.config') } - - this.init() } module.exports = Files