fix: prevent new workspace modal from getting stuck in an open state (#173)

This commit is contained in:
Henry
2025-09-11 22:29:48 +01:00
committed by GitHub
parent 2f88366418
commit 4ee1d6f2d5
3 changed files with 47 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
import { t } from "@lingui/core/macro";
import { useEffect } from "react";
import { HiArrowDownTray, HiOutlinePlusSmall } from "react-icons/hi2";
import Button from "~/components/Button";
@@ -16,7 +17,11 @@ export default function BoardsPage() {
const { openModal, modalContentType, isOpen } = useModal();
const { availableWorkspaces, workspace, hasLoaded } = useWorkspace();
if (hasLoaded && availableWorkspaces.length === 0) openModal("NEW_WORKSPACE");
useEffect(() => {
if (hasLoaded && availableWorkspaces.length === 0) {
openModal("NEW_WORKSPACE");
}
}, [hasLoaded, availableWorkspaces.length, openModal]);
return (
<>