treat all files objects the same

pull/1/head
serapath 7 years ago
parent 583a2463e8
commit e8cd1d4423
  1. 1
      src/app/files/basicReadOnlyExplorer.js
  2. 3
      src/app/files/file-explorer.js

@ -83,6 +83,7 @@ class BasicReadOnlyExplorer {
resolveDirectory (path, callback /* (error, filesList) => { } */) { resolveDirectory (path, callback /* (error, filesList) => { } */) {
var self = this var self = this
if (path[0] === '/') path = path.substring(1) if (path[0] === '/') path = path.substring(1)
if (!path) return callback(null, { [self.type]: { } })
var tree = {} var tree = {}
// This does not include '.remix.config', because it is filtered // This does not include '.remix.config', because it is filtered
// inside list(). // inside list().

@ -101,8 +101,7 @@ function fileExplorer (appAPI, files) {
} }
}, },
formatSelf: function formatSelf (key, data, li) { formatSelf: function formatSelf (key, data, li) {
var isRoot = !data.path.indexOf('browser') && data.path.length === 'browser'.length var isRoot = data.path.indexOf('/') === -1
isRoot = isRoot || !data.path.indexOf('localhost') && data.path.length === 'localhost'.length
return yo`<label class="${data.children ? css.folder : css.file}" return yo`<label class="${data.children ? css.folder : css.file}"
data-path="${data.path}" data-path="${data.path}"
style="${isRoot ? 'font-weight:bold;' : ''}" style="${isRoot ? 'font-weight:bold;' : ''}"

Loading…
Cancel
Save