treat all files objects the same

pull/3094/head
serapath 7 years ago
parent e220887bdd
commit 5ec930b7e4
  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