fix basicReadOnlyExplorer

pull/3094/head
yann300 7 years ago
parent 0892c2a44d
commit 4145863d10
  1. 4
      src/app/files/basicReadOnlyExplorer.js

@ -27,7 +27,8 @@ class BasicReadOnlyExplorer {
} }
get (path, cb) { get (path, cb) {
var content = this.files[path] var unprefixedPath = this.removePrefix(path)
var content = this.files[unprefixedPath]
if (!content) { if (!content) {
content = this.files[this.type + '/' + this.normalizedNames[path]] content = this.files[this.type + '/' + this.normalizedNames[path]]
} }
@ -48,6 +49,7 @@ class BasicReadOnlyExplorer {
try { // lazy try to format JSON try { // lazy try to format JSON
content = JSON.stringify(JSON.parse(content), null, '\t') content = JSON.stringify(JSON.parse(content), null, '\t')
} catch (e) {} } catch (e) {}
if (!rawPath) rawPath = path
// splitting off the path in a tree structure, the json tree is used in `resolveDirectory` // splitting off the path in a tree structure, the json tree is used in `resolveDirectory`
var split = path var split = path
var folder = false var folder = false

Loading…
Cancel
Save