mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 18:40:34 -05:00
Convert ManagementApp.jsx to tsx (#3860)
* Convert ManagementApp to tsx * Release notes
This commit is contained in:
committed by
GitHub
parent
278ac0c730
commit
f523d25052
@@ -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 (
|
||||
<View style={{ height: '100%', color: theme.pageText }}>
|
||||
6
upcoming-release-notes/3860.md
Normal file
6
upcoming-release-notes/3860.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [joel-jeremy]
|
||||
---
|
||||
|
||||
Convert ManagementApp to tsx
|
||||
Reference in New Issue
Block a user