Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 86a2cd0

Browse files
Fix: triage not opening
1 parent 76bdfde commit 86a2cd0

File tree

7 files changed

+31
-24
lines changed

7 files changed

+31
-24
lines changed

apps/server/src/modules/replication/replication.service.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,13 @@ export default class ReplicationService {
249249
modelId,
250250
);
251251

252-
const recipientId =
253-
modelName in
254-
[
255-
ModelNameEnum.Notification,
256-
ModelNameEnum.Conversation,
257-
ModelNameEnum.ConversationHistory,
258-
]
259-
? syncActionData.data.userId
260-
: syncActionData.workspaceId;
252+
const recipientId = [
253+
ModelNameEnum.Notification,
254+
ModelNameEnum.Conversation,
255+
ModelNameEnum.ConversationHistory,
256+
].includes(modelName)
257+
? syncActionData.data.userId
258+
: syncActionData.workspaceId;
261259

262260
this.syncGateway.wss
263261
.to(recipientId)

apps/webapp/src/hooks/use-triage-groups.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@ import { useTeamWorkflows } from './workflows';
1313
export function useTriageGroups() {
1414
const currentTeam = useCurrentTeam();
1515
const { issuesStore, issueSuggestionsStore } = useContextStore();
16-
const workflows = useTeamWorkflows(currentTeam.identifier);
16+
const workflows = useTeamWorkflows(currentTeam?.identifier);
17+
1718
const triageWorkflow = workflows.find(
1819
(workflow: WorkflowType) =>
1920
workflow.category === WorkflowCategoryEnum.TRIAGE,
2021
);
2122

22-
const issues = sort(issuesStore.getIssuesForState([triageWorkflow.id])).desc(
23-
(issue: IssueType) => new Date(issue.updatedAt),
24-
) as IssueType[];
25-
2623
return React.useMemo(() => {
2724
const allIssueSuggestions: IssueSuggestionType[] = [];
2825

26+
if (!triageWorkflow) {
27+
return {};
28+
}
29+
30+
const issues = sort(
31+
issuesStore.getIssuesForState([triageWorkflow.id], {}),
32+
).desc((issue: IssueType) => new Date(issue.updatedAt)) as IssueType[];
33+
2934
// Fetch issue suggestions for each issue ID
3035
for (const issue of issues) {
3136
const issueSuggestions =
@@ -89,5 +94,5 @@ export function useTriageGroups() {
8994

9095
return issueCategories;
9196
// eslint-disable-next-line react-hooks/exhaustive-deps
92-
}, [issues]);
97+
}, [triageWorkflow, issuesStore.getIssues({}).length]);
9398
}

apps/webapp/src/hooks/workflows/use-team-workflows.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function useTeamWorkflows(
5858

5959
const workflows = React.useMemo(
6060
() => computed(() => getWorkflows()),
61-
[team, workflowsStore.workflows.length, teamIdentifier],
61+
[teamIdentifier, team, workflowsStore.workflows.length],
6262
).get();
6363

6464
return workflows;
@@ -68,7 +68,7 @@ export function useAllWorkflows(): WorkflowType[] | undefined {
6868
const { workflowsStore } = useContextStore();
6969

7070
const getWorkflows = () => {
71-
const workflows = workflowsStore.workflows.sort(workflowSort);
71+
const workflows = [...workflowsStore.workflows].sort(workflowSort);
7272

7373
return workflows;
7474
};

apps/webapp/src/modules/ai/conversation.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ export const Conversation = observer(() => {
9090
}
9191
};
9292

93-
console.log(commonStore.currentConversationId);
94-
9593
const lastThought = thoughts[thoughts.length - 1];
9694

9795
return (

apps/webapp/src/modules/issues/triage/left-side/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function Header({ title }: HeaderProps) {
2121
<Breadcrumb>
2222
<BreadcrumbItem>
2323
<BreadcrumbLink className="flex items-center gap-2">
24-
<TeamIcon name={team.name} />
24+
<TeamIcon name={team?.name} />
2525

2626
<span className="inline-block"> {title}</span>
2727
</BreadcrumbLink>

apps/webapp/src/modules/issues/triage/left-side/triage-issues.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { ScrollArea } from '@tegonhq/ui/components/scroll-area';
2+
import { observer } from 'mobx-react-lite';
23

34
import { useTriageGroups } from 'hooks';
45
import { useUsersData } from 'hooks/users';
56

67
import { TriageCategory } from './triage-category';
78
import { TriageOtherCategory } from './triage-other-category';
89

9-
export const TriageIssues = () => {
10+
export const TriageIssues = observer(() => {
1011
const { users, isLoading } = useUsersData();
1112

1213
const issueCategories = useTriageGroups();
@@ -42,4 +43,4 @@ export const TriageIssues = () => {
4243
</div>
4344
</ScrollArea>
4445
);
45-
};
46+
});

apps/webapp/src/modules/issues/triage/right-side.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ import { useContextStore } from 'store/global-context-provider';
1313
export const RightSide = observer(() => {
1414
const currentTeam = useCurrentTeam();
1515
const { issuesStore } = useContextStore();
16-
const workflows = useTeamWorkflows(currentTeam.identifier);
16+
const workflows = useTeamWorkflows(currentTeam?.identifier);
1717
const triageWorkflow = workflows.find(
1818
(workflow: WorkflowType) =>
1919
workflow.category === WorkflowCategoryEnum.TRIAGE,
2020
);
21-
const issues = issuesStore.getIssuesForState([triageWorkflow.id], false);
21+
22+
if (!triageWorkflow) {
23+
return null;
24+
}
25+
26+
const issues = issuesStore.getIssuesForState([triageWorkflow.id], {});
2227

2328
return (
2429
<div className="p-6 flex flex-col items-center justify-center gap-2">

0 commit comments

Comments
 (0)