[WEB-2770] fix: inbox issue detail loader on focus change (#6074)
This commit is contained in:
parent
a3e8ee6045
commit
6f497b024b
1 changed files with 8 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect } from "react";
|
import { useCallback, useEffect } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
|
@ -62,6 +62,11 @@ const WorkspaceDashboardPage = observer(() => {
|
||||||
workspace_slug && project_id && is_inbox_issue ? () => fetchUserProjectInfo(workspace_slug, project_id) : null
|
workspace_slug && project_id && is_inbox_issue ? () => fetchUserProjectInfo(workspace_slug, project_id) : null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const embedRemoveCurrentNotification = useCallback(
|
||||||
|
() => setCurrentSelectedNotificationId(undefined),
|
||||||
|
[setCurrentSelectedNotificationId]
|
||||||
|
);
|
||||||
|
|
||||||
// clearing up the selected notifications when unmounting the page
|
// clearing up the selected notifications when unmounting the page
|
||||||
useEffect(
|
useEffect(
|
||||||
() => () => {
|
() => () => {
|
||||||
|
|
@ -95,15 +100,12 @@ const WorkspaceDashboardPage = observer(() => {
|
||||||
projectId={project_id}
|
projectId={project_id}
|
||||||
inboxIssueId={issue_id}
|
inboxIssueId={issue_id}
|
||||||
isNotificationEmbed
|
isNotificationEmbed
|
||||||
embedRemoveCurrentNotification={() => setCurrentSelectedNotificationId(undefined)}
|
embedRemoveCurrentNotification={embedRemoveCurrentNotification}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<IssuePeekOverview
|
<IssuePeekOverview embedIssue embedRemoveCurrentNotification={embedRemoveCurrentNotification} />
|
||||||
embedIssue
|
|
||||||
embedRemoveCurrentNotification={() => setCurrentSelectedNotificationId(undefined)}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue