From 1c02d45fd72f73e66f3585fa586e1b31138a953b Mon Sep 17 00:00:00 2001 From: Neelesh Singh Date: Tue, 4 Aug 2020 23:46:25 +0530 Subject: [PATCH] sort existing files before displaying --- client/modules/IDE/reducers/files.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/reducers/files.js b/client/modules/IDE/reducers/files.js index 9be4667e..404a1aee 100644 --- a/client/modules/IDE/reducers/files.js +++ b/client/modules/IDE/reducers/files.js @@ -227,7 +227,12 @@ const files = (state, action) => { return file; }); default: - return state; + return state.map((file) => { + if (file.name === 'root') { + file.children = sortedChildrenId(state, file.children); + } + return file; + }); } };