Skip to content

Commit

Permalink
Sorted categories on modification or creation (mattermost-community#2856
Browse files Browse the repository at this point in the history
)

* Sorted categories on modification or creation

* Sorting only once

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Minor cleanup

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
  • Loading branch information
harshilsharma63 and sbishel authored Apr 22, 2022
1 parent eace2da commit ec9085c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webapp/src/store/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ const sidebarSlice = createSlice({
}
}
})

// sort categories alphabetically
state.categoryAttributes.sort((a, b) => a.name.localeCompare(b.name))
},
updateBoardCategories: (state, action: PayloadAction<Array<BoardCategoryWebsocketData>>) => {
action.payload.forEach((boardCategory) => {
Expand Down

0 comments on commit ec9085c

Please sign in to comment.