Skip to content

Commit

Permalink
[WEB-2770] fix: inbox issue detail loader on focus change (#6074)
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekshourya29 authored Nov 19, 2024
1 parent a3e8ee6 commit 6f497b0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions web/app/[workspaceSlug]/(projects)/notifications/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useEffect } from "react";
import { useCallback, useEffect } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import useSWR from "swr";
Expand Down Expand Up @@ -62,6 +62,11 @@ const WorkspaceDashboardPage = observer(() => {
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
useEffect(
() => () => {
Expand Down Expand Up @@ -95,15 +100,12 @@ const WorkspaceDashboardPage = observer(() => {
projectId={project_id}
inboxIssueId={issue_id}
isNotificationEmbed
embedRemoveCurrentNotification={() => setCurrentSelectedNotificationId(undefined)}
embedRemoveCurrentNotification={embedRemoveCurrentNotification}
/>
)}
</>
) : (
<IssuePeekOverview
embedIssue
embedRemoveCurrentNotification={() => setCurrentSelectedNotificationId(undefined)}
/>
<IssuePeekOverview embedIssue embedRemoveCurrentNotification={embedRemoveCurrentNotification} />
)}
</>
)}
Expand Down

0 comments on commit 6f497b0

Please sign in to comment.