diff --git a/packages/desktop-client/src/components/manager/ManagementApp.jsx b/packages/desktop-client/src/components/manager/ManagementApp.tsx similarity index 94% rename from packages/desktop-client/src/components/manager/ManagementApp.jsx rename to packages/desktop-client/src/components/manager/ManagementApp.tsx index fc0dfc2aeb6..194ecadd1ba 100644 --- a/packages/desktop-client/src/components/manager/ManagementApp.jsx +++ b/packages/desktop-client/src/components/manager/ManagementApp.tsx @@ -2,11 +2,7 @@ import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Navigate, Route, Routes } from 'react-router-dom'; -import { - getUserData, - loadAllFiles, - setAppState, -} from 'loot-core/client/actions'; +import { loggedIn, setAppState } from 'loot-core/client/actions'; import { useMetaThemeColor } from '../../hooks/useMetaThemeColor'; import { theme } from '../../style'; @@ -55,7 +51,9 @@ function Version() { export function ManagementApp() { const { isNarrowWidth } = useResponsive(); - useMetaThemeColor(isNarrowWidth ? theme.mobileConfigServerViewTheme : null); + useMetaThemeColor( + isNarrowWidth ? theme.mobileConfigServerViewTheme : undefined, + ); const files = useSelector(state => state.budgets.allFiles); const isLoading = useSelector(state => state.app.loadingText !== null); @@ -69,16 +67,12 @@ export function ManagementApp() { // runs on mount only useEffect(() => { async function fetchData() { - const userData = await dispatch(getUserData()); - if (userData) { - await dispatch(loadAllFiles()); - } - + await dispatch(loggedIn()); dispatch(setAppState({ managerHasInitialized: true })); } fetchData(); - }, []); + }, [dispatch]); return ( diff --git a/upcoming-release-notes/3860.md b/upcoming-release-notes/3860.md new file mode 100644 index 00000000000..bab5f68baf0 --- /dev/null +++ b/upcoming-release-notes/3860.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [joel-jeremy] +--- + +Convert ManagementApp to tsx