diff --git a/apps/app/contexts/issue-view.context.tsx b/apps/app/contexts/issue-view.context.tsx index dbf1d9a83..530dbee4e 100644 --- a/apps/app/contexts/issue-view.context.tsx +++ b/apps/app/contexts/issue-view.context.tsx @@ -362,7 +362,13 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> = }, }); - if (property === "kanban") { + const additionalProperties = { + groupByProperty: state.groupByProperty, + orderBy: state.orderBy, + }; + + if (property === "kanban" && state.groupByProperty === null) { + additionalProperties.groupByProperty = "state"; dispatch({ type: "SET_GROUP_BY_PROPERTY", payload: { @@ -371,6 +377,7 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> = }); } if (property === "calendar") { + additionalProperties.groupByProperty = null; dispatch({ type: "SET_GROUP_BY_PROPERTY", payload: { @@ -378,13 +385,22 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> = }, }); } + if (property === "gantt_chart") { + additionalProperties.orderBy = "sort_order"; + dispatch({ + type: "SET_ORDER_BY_PROPERTY", + payload: { + orderBy: "sort_order", + }, + }); + } if (!workspaceSlug || !projectId) return; saveDataToServer(workspaceSlug as string, projectId as string, { ...state, issueView: property, - groupByProperty: "state", + ...additionalProperties, }); }, [workspaceSlug, projectId, state]