π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
fix view layout in space app (#5225)
rahulramesha1c155f6cbe56
diff --git a/space/app/views/[anchor]/layout.tsx b/space/app/views/[anchor]/layout.tsxindex 81d0c992d0..cf7643bb60 100644--- a/space/app/views/[anchor]/layout.tsx+++ b/space/app/views/[anchor]/layout.tsx@@ -5,6 +5,7 @@ import Image from "next/image";import useSWR from "swr";// componentsimport { LogoSpinner } from "@/components/common";+import { SomethingWentWrongError } from "@/components/issues/issue-layouts/error";// hooksimport { usePublish, usePublishList } from "@/hooks/store";// Plane web@@ -28,25 +29,22 @@ const IssuesLayout = observer((props: Props) => {const { fetchPublishSettings } = usePublishList();const { viewData, fetchViewDetails } = useView();const publishSettings = usePublish(anchor);- // fetch publish settings- useSWR(- anchor ? `PUBLISH_SETTINGS_${anchor}` : null,- anchor- ? async () => {- await fetchPublishSettings(anchor);- }- : null- );- // fetch view data- useSWR(- anchor ? `VIEW_DETAILS_${anchor}` : null,++ // fetch publish settings && view details+ const { error } = useSWR(+ anchor ? `PUBLISHED_VIEW_SETTINGS_${anchor}` : null,anchor? async () => {- await fetchViewDetails(anchor);+ const promises = [];+ promises.push(fetchPublishSettings(anchor));+ promises.push(fetchViewDetails(anchor));+ await Promise.all(promises);}: null);+ if (error) return <SomethingWentWrongError />;+if (!publishSettings || !viewData) return <LogoSpinner />;return (