[WEB-1829] fix: stop issues query before fetching the view filters (#5015)

* fix to not query issues before fetching the view filters

* add default group by for Kanban views
This commit is contained in:
rahulramesha 2024-07-03 16:25:41 +05:30 committed by GitHub
parent 825b2f26bf
commit a7aa5c2ba7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import { useParams } from "next/navigation";
import useSWR from "swr";
// mobx store
// components
import { LogoSpinner } from "@/components/common";
import {
IssuePeekOverview,
ProjectViewAppliedFiltersRoot,
@ -42,7 +43,7 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => {
// hooks
const { issuesFilter } = useIssues(EIssuesStoreType.PROJECT_VIEW);
useSWR(
const { isLoading } = useSWR(
workspaceSlug && projectId && viewId ? `PROJECT_VIEW_ISSUES_${workspaceSlug}_${projectId}_${viewId}` : null,
async () => {
if (workspaceSlug && projectId && viewId) {
@ -56,6 +57,14 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => {
if (!workspaceSlug || !projectId || !viewId) return <></>;
if (isLoading) {
return (
<div className="relative flex h-screen w-full items-center justify-center">
<LogoSpinner />
</div>
);
}
return (
<IssuesStoreContext.Provider value={EIssuesStoreType.PROJECT_VIEW}>
<div className="relative flex h-full w-full flex-col overflow-hidden">