diff --git a/.changeset/tender-countries-lie.md b/.changeset/tender-countries-lie.md new file mode 100644 index 0000000..300d669 --- /dev/null +++ b/.changeset/tender-countries-lie.md @@ -0,0 +1,7 @@ +--- +'gov4git-desktop-app': patch +--- + +Fix error screen + +- Clear loaders after error. diff --git a/src/renderer/src/pages/layout/Layout.tsx b/src/renderer/src/pages/layout/Layout.tsx index 8349a75..c0b86fd 100644 --- a/src/renderer/src/pages/layout/Layout.tsx +++ b/src/renderer/src/pages/layout/Layout.tsx @@ -21,13 +21,6 @@ export const Layout = function Layout() { const navigate = useNavigate() const settingsError = useGlobalSettingsErrors() const userLoaded = useDataStore((s) => s.userInfo.userLoaded) - const communitiesLoaded = useDataStore( - (s) => s.communityInfo.communitiesLoaded, - ) - - const loading = useMemo(() => { - return !userLoaded || !communitiesLoaded - }, [userLoaded, communitiesLoaded]) useEffect(() => { if (exceptionMessage !== '') { @@ -60,7 +53,7 @@ export const Layout = function Layout() {
- +
diff --git a/src/renderer/src/store/errorStore.ts b/src/renderer/src/store/errorStore.ts index bd4c9fb..5e87087 100644 --- a/src/renderer/src/store/errorStore.ts +++ b/src/renderer/src/store/errorStore.ts @@ -60,6 +60,12 @@ export const createErrorStore: StateCreator< s.exception = `${msg} ${ex}` }) } + set((s) => { + s.motionInfo.loading = false + s.communityInfo.loading = false + s.userInfo.loading = false + s.userInfo.userLoaded = true + }) } }, })