Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-1792] fix: handled redirection issue when we change the status of the inbox issue in the notification (#5014)

guru_sainathfc15ca556545
diff --git a/web/core/components/inbox/content/inbox-issue-header.tsx b/web/core/components/inbox/content/inbox-issue-header.tsx
index 9c46a31092..a7302005af 100644
--- a/web/core/components/inbox/content/inbox-issue-header.tsx
+++ b/web/core/components/inbox/content/inbox-issue-header.tsx
@@ -101,11 +101,13 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
};
const handleRedirection = (nextOrPreviousIssueId: string | undefined) => {
- if (nextOrPreviousIssueId)
- router.push(
- `/${workspaceSlug}/projects/${projectId}/inbox?currentTab=${currentTab}&inboxIssueId=${nextOrPreviousIssueId}`
- );
- else router.push(`/${workspaceSlug}/projects/${projectId}/inbox?currentTab=${currentTab}`);
+ if (!isNotificationEmbed) {
+ if (nextOrPreviousIssueId)
+ router.push(
+ `/${workspaceSlug}/projects/${projectId}/inbox?currentTab=${currentTab}&inboxIssueId=${nextOrPreviousIssueId}`
+ );
+ else router.push(`/${workspaceSlug}/projects/${projectId}/inbox?currentTab=${currentTab}`);
+ }
};
const handleInboxIssueAccept = async () => {
@@ -136,7 +138,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
const handleInboxIssueDelete = async () => {
if (!inboxIssue || !currentInboxIssueId) return;
await deleteInboxIssue(workspaceSlug, projectId, currentInboxIssueId).finally(() => {
- router.push(`/${workspaceSlug}/projects/${projectId}/inbox`);
+ if (!isNotificationEmbed) router.push(`/${workspaceSlug}/projects/${projectId}/inbox`);
});
};
@@ -189,11 +191,11 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
);
useEffect(() => {
- document.addEventListener("keydown", onKeyDown);
+ if (!isNotificationEmbed) document.addEventListener("keydown", onKeyDown);
return () => {
- document.removeEventListener("keydown", onKeyDown);
+ if (!isNotificationEmbed) document.removeEventListener("keydown", onKeyDown);
};
- }, [onKeyDown]);
+ }, [onKeyDown, isNotificationEmbed]);
if (!inboxIssue) return null;