Skip to content

Commit d30f69d

Browse files
author
filip mertens
committed
rm local files from state on root change
1 parent 531888e commit d30f69d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/remix-ui/workspace/src/lib/reducers/workspace.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
334334

335335
case 'ROOT_FOLDER_CHANGED': {
336336
const payload = action.payload as string
337-
338337
return {
339338
...state,
340339
localhost: {
341340
...state.localhost,
342-
sharedFolder: payload
341+
sharedFolder: payload,
342+
files: []
343343
}
344344
}
345345
}
@@ -673,9 +673,9 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
673673
}
674674
} else {
675675
if (payload.path === state.mode || payload.path === '/') {
676-
const files = normalize(payload.fileTree, payload.path, payload.type)
676+
let files = normalize(payload.fileTree, payload.path, payload.type)
677677

678-
// files = _.merge(files, state[state.mode].files[state.mode])
678+
files = _.merge(files, state[state.mode].files[state.mode])
679679
if (deletePath) delete files[deletePath]
680680
return { [state.mode]: files }
681681
} else {

0 commit comments

Comments
 (0)