Skip to content

Commit

Permalink
remove unnecessary init() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
serapath committed Jan 8, 2018
1 parent 2748c0e commit 098b6f0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/app/files/browser-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Files (storage) {
}

this.init = function (cb) {
this.resolveDirectory('', (error, filesTree) => cb && cb(error))
cb()
}

this.get = function (path, cb) {
Expand Down Expand Up @@ -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])
Expand All @@ -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
}
Expand All @@ -88,7 +86,6 @@ function Files (storage) {
return false
}
}
this.init()
event.trigger('fileRemoved', [this.type + '/' + unprefixedpath])
return true
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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

0 comments on commit 098b6f0

Please sign in to comment.