Revert unrelated changes

This commit is contained in:
Joel Jeremy Marquez
2026-02-18 21:31:32 +00:00
parent 470fb13d37
commit 158c79281d
2 changed files with 3 additions and 31 deletions

View File

@@ -4,7 +4,6 @@ import type { ComponentType } from 'react';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
import { useQuery } from '@tanstack/react-query';
import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
@@ -20,7 +19,6 @@ import * as trackingBudget from './tracking/TrackingBudgetComponents';
import { TrackingBudgetProvider } from './tracking/TrackingBudgetContext';
import { prewarmAllMonths, prewarmMonth } from './util';
import { accountQueries } from '@desktop-client/accounts';
import {
useBudgetActions,
useDeleteCategoryGroupMutation,
@@ -30,7 +28,6 @@ import {
useSaveCategoryGroupMutation,
useSaveCategoryMutation,
} from '@desktop-client/budget';
import { LoadingIndicator } from '@desktop-client/components/reports/LoadingIndicator';
import { useCategories } from '@desktop-client/hooks/useCategories';
import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
@@ -78,17 +75,6 @@ export function Budget() {
});
useEffect(() => init(), []);
const { data: accounts, isPending: isAccountsLoading } = useQuery(
accountQueries.list(),
);
useEffect(() => {
if (!isAccountsLoading && accounts.length === 0) {
// New budget file, no accounts exists
navigate('/accounts');
}
}, [isAccountsLoading, accounts, navigate]);
const loadBoundBudgets = useEffectEvent(() => {
send('get-budget-bounds').then(({ start, end }) => {
if (bounds.start !== start || bounds.end !== end) {
@@ -188,8 +174,8 @@ export function Budget() {
applyBudgetAction.mutate({ month, type, args });
};
if (!initialized || !categoryGroups || isAccountsLoading) {
return <LoadingIndicator />;
if (!initialized || !categoryGroups) {
return null;
}
let table;

View File

@@ -26,7 +26,6 @@ import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { useQuery } from '@tanstack/react-query';
import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
@@ -35,7 +34,6 @@ import type { TransObjectLiteral } from 'loot-core/types/util';
import { BudgetTable, PILL_STYLE } from './BudgetTable';
import { accountQueries } from '@desktop-client/accounts';
import { sync } from '@desktop-client/app/appSlice';
import {
useBudgetActions,
@@ -106,18 +104,6 @@ export function BudgetPage() {
const saveCategoryGroup = useSaveCategoryGroupMutation();
const deleteCategoryGroup = useDeleteCategoryGroupMutation();
const { data: accounts, isSuccess: isAccountsLoaded } = useQuery(
accountQueries.list(),
);
const navigate = useNavigate();
useEffect(() => {
if (isAccountsLoaded && accounts.length === 0) {
// New file, no accounts exists
navigate('/accounts');
}
}, [isAccountsLoaded, accounts, navigate]);
useEffect(() => {
async function init() {
const { start, end } = await send('get-budget-bounds');
@@ -534,7 +520,7 @@ export function BudgetPage() {
onToggleHiddenCategories,
]);
if (!categoryGroups || !initialized || !isAccountsLoaded) {
if (!categoryGroups || !initialized) {
return (
<View
style={{