From f523d2505223b0fd8d750c2cf7a0b145d2280c0f Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Wed, 20 Nov 2024 14:53:23 -0800 Subject: [PATCH] Convert ManagementApp.jsx to tsx (#3860) * Convert ManagementApp to tsx * Release notes --- .../{ManagementApp.jsx => ManagementApp.tsx} | 18 ++++++------------ upcoming-release-notes/3860.md | 6 ++++++ 2 files changed, 12 insertions(+), 12 deletions(-) rename packages/desktop-client/src/components/manager/{ManagementApp.jsx => ManagementApp.tsx} (94%) create mode 100644 upcoming-release-notes/3860.md 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