From 9c64e04eeb234de69a99fe9c334bfa9f5a5725df 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 935106b0fa63d2b6dcd062414c945f5328587eaf 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 ae53207148d636475abef21853a3d35f5b934423 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 bd080f4169f11d716b9f12c97e1523b13d295907 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)