From e8cd1d44235a5c2c8edcd964b39d2efd8e706b4a Mon Sep 17 00:00:00 2001 From: serapath Date: Wed, 17 Jan 2018 01:08:14 +0800 Subject: [PATCH] treat all files objects the same --- src/app/files/basicReadOnlyExplorer.js | 1 + src/app/files/file-explorer.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/files/basicReadOnlyExplorer.js b/src/app/files/basicReadOnlyExplorer.js index d5a92bdae8..fa3006f53a 100644 --- a/src/app/files/basicReadOnlyExplorer.js +++ b/src/app/files/basicReadOnlyExplorer.js @@ -83,6 +83,7 @@ class BasicReadOnlyExplorer { resolveDirectory (path, callback /* (error, filesList) => { } */) { var self = this if (path[0] === '/') path = path.substring(1) + if (!path) return callback(null, { [self.type]: { } }) var tree = {} // This does not include '.remix.config', because it is filtered // inside list(). diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 48c341995e..15baaf437d 100755 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -101,8 +101,7 @@ function fileExplorer (appAPI, files) { } }, formatSelf: function formatSelf (key, data, li) { - var isRoot = !data.path.indexOf('browser') && data.path.length === 'browser'.length - isRoot = isRoot || !data.path.indexOf('localhost') && data.path.length === 'localhost'.length + var isRoot = data.path.indexOf('/') === -1 return yo`