fix: issues widget loading state

This commit is contained in:
Aaryan Khandelwal
2024-04-15 13:53:52 +05:30
parent 29dc040227
commit 209977a7f3
2 changed files with 6 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {
updateMarkings(description_html ?? "<p></p>");
}, [description_html, updateMarkings]);
if (!issues && issuesLoading)
if (!issues || issuesLoading)
return (
<div className="h-full w-full grid place-items-center">
<Spinner />

View File

@@ -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 ?? {});