Skip to content

Commit

Permalink
Convert ManagementApp.jsx to tsx (#3860)
Browse files Browse the repository at this point in the history
* Convert ManagementApp to tsx

* Release notes
  • Loading branch information
joel-jeremy authored Nov 20, 2024
1 parent 278ac0c commit f523d25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand All @@ -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 (
<View style={{ height: '100%', color: theme.pageText }}>
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3860.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [joel-jeremy]
---

Convert ManagementApp to tsx

0 comments on commit f523d25

Please sign in to comment.