From 209977a7f36e2ac9e2d2b1bf69312f01516605cf Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Mon, 15 Apr 2024 13:53:52 +0530 Subject: [PATCH] fix: issues widget loading state --- web/components/pages/editor/editor-body.tsx | 2 +- web/hooks/use-issue-embeds.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/components/pages/editor/editor-body.tsx b/web/components/pages/editor/editor-body.tsx index 39b07e446c..4c1f68cc6f 100644 --- a/web/components/pages/editor/editor-body.tsx +++ b/web/components/pages/editor/editor-body.tsx @@ -91,7 +91,7 @@ export const PageEditorBody: React.FC = observer((props) => { updateMarkings(description_html ?? "

"); }, [description_html, updateMarkings]); - if (!issues && issuesLoading) + if (!issues || issuesLoading) return (
diff --git a/web/hooks/use-issue-embeds.tsx b/web/hooks/use-issue-embeds.tsx index 99bc7e909f..43e1f99bd3 100644 --- a/web/hooks/use-issue-embeds.tsx +++ b/web/hooks/use-issue-embeds.tsx @@ -19,7 +19,11 @@ export const useIssueEmbeds = () => { const { data: issuesResponse, isLoading: issuesLoading } = useSWR( workspaceSlug && projectId ? PROJECT_ISSUES_LIST(workspaceSlug as string, projectId as string) : null, - workspaceSlug && projectId ? () => issueService.getIssues(workspaceSlug as string, projectId as string) : null + workspaceSlug && projectId ? () => issueService.getIssues(workspaceSlug as string, projectId as string) : null, + { + revalidateOnFocus: false, + revalidateIfStale: false, + } ); const issues = Object.values(issuesResponse ?? {});