From ec9085cd2590707f277e540352a984e60a964e2a Mon Sep 17 00:00:00 2001 From: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com> Date: Fri, 22 Apr 2022 22:18:49 +0530 Subject: [PATCH] Sorted categories on modification or creation (#2856) * Sorted categories on modification or creation * Sorting only once Co-authored-by: Scott Bishel * Minor cleanup Co-authored-by: Scott Bishel --- webapp/src/store/sidebar.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webapp/src/store/sidebar.ts b/webapp/src/store/sidebar.ts index 95964e827..c13ca7cca 100644 --- a/webapp/src/store/sidebar.ts +++ b/webapp/src/store/sidebar.ts @@ -69,6 +69,9 @@ const sidebarSlice = createSlice({ } } }) + + // sort categories alphabetically + state.categoryAttributes.sort((a, b) => a.name.localeCompare(b.name)) }, updateBoardCategories: (state, action: PayloadAction>) => { action.payload.forEach((boardCategory) => {