From 9cce029b3fc526c276d0f91cad8b35740bdcb623 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 4 Jan 2022 13:59:53 +0530 Subject: [PATCH 1/4] do not merge files for localhost workspace --- libs/remix-ui/workspace/src/lib/reducers/workspace.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index e046892df9..1f1d60ae0e 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -674,8 +674,6 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s } else { if (payload.path === state.mode || payload.path === '/') { let files = normalize(payload.fileTree, payload.path, payload.type) - - files = _.merge(files, state[state.mode].files[state.mode]) if (deletePath) delete files[deletePath] return { [state.mode]: files } } else { From 27590acafbbe5c699f1c98a9bc22f6245b62ad75 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 4 Jan 2022 14:10:21 +0530 Subject: [PATCH 2/4] linting fix --- libs/remix-ui/workspace/src/lib/reducers/workspace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index 1f1d60ae0e..46b8b47f53 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -673,7 +673,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s } } else { if (payload.path === state.mode || payload.path === '/') { - let files = normalize(payload.fileTree, payload.path, payload.type) + const files = normalize(payload.fileTree, payload.path, payload.type) if (deletePath) delete files[deletePath] return { [state.mode]: files } } else { From 7fc21383bfbfccf3d37e6e8711b50ccc3c420141 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jan 2022 20:45:18 +0530 Subject: [PATCH 3/4] fix remixd initial load --- libs/remix-ui/workspace/src/lib/reducers/workspace.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index 46b8b47f53..613c1db3b7 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -672,8 +672,12 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s return files } } else { - if (payload.path === state.mode || payload.path === '/') { - const files = normalize(payload.fileTree, payload.path, payload.type) + if (payload.path === '/') { + let files = normalize(payload.fileTree, payload.path, payload.type) + return { [state.mode]: files } + } else if (payload.path === state.mode) { + let files = normalize(payload.fileTree, payload.path, payload.type) + files = _.merge(files, state[state.mode].files[state.mode]) if (deletePath) delete files[deletePath] return { [state.mode]: files } } else { From 629d34f5efae65b1338c8182e4b637dc138a7dab Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jan 2022 20:57:51 +0530 Subject: [PATCH 4/4] linting fix --- libs/remix-ui/workspace/src/lib/reducers/workspace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index 613c1db3b7..ef769f5c5b 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -673,7 +673,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s } } else { if (payload.path === '/') { - let files = normalize(payload.fileTree, payload.path, payload.type) + const files = normalize(payload.fileTree, payload.path, payload.type) return { [state.mode]: files } } else if (payload.path === state.mode) { let files = normalize(payload.fileTree, payload.path, payload.type)