diff --git a/.eslintrc.js b/.eslintrc.js index b04dd7f711e..e8ddb235a4a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -483,7 +483,7 @@ module.exports = { { group: ['react-redux'], importNames: ['useDispatch'], - message: 'Please use Actual’s useAppDispatch() hook instead.', + message: 'Please use Actual’s useDispatch() hook instead.', }, ], }, @@ -501,7 +501,7 @@ module.exports = { { group: ['react-redux'], importNames: ['useSelector'], - message: 'Please use Actual’s useAppSelector() hook instead.', + message: 'Please use Actual’s useSelector() hook instead.', }, ], }, diff --git a/packages/desktop-client/src/components/App.tsx b/packages/desktop-client/src/components/App.tsx index 9c1d6a10cf7..d7c9ca4fac9 100644 --- a/packages/desktop-client/src/components/App.tsx +++ b/packages/desktop-client/src/components/App.tsx @@ -27,7 +27,7 @@ import { import { useMetadataPref } from '../hooks/useMetadataPref'; import { installPolyfills } from '../polyfills'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; import { styles, hasHiddenScrollbars, ThemeStyle, useTheme } from '../style'; import { ExposeNavigate } from '../util/router-tools'; @@ -48,7 +48,7 @@ function AppInner() { const [cloudFileId] = useMetadataPref('cloudFileId'); const { t } = useTranslation(); const { showBoundary: showErrorBoundary } = useErrorBoundary(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const maybeUpdate = async (cb?: () => T): Promise => { if (global.Actual.isUpdateReadyForDownload()) { @@ -139,7 +139,7 @@ export function App() { const [hiddenScrollbars, setHiddenScrollbars] = useState( hasHiddenScrollbars(), ); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); useEffect(() => { function checkScrollbars() { diff --git a/packages/desktop-client/src/components/AppBackground.tsx b/packages/desktop-client/src/components/AppBackground.tsx index e3e5ef3c3b4..423412e31e4 100644 --- a/packages/desktop-client/src/components/AppBackground.tsx +++ b/packages/desktop-client/src/components/AppBackground.tsx @@ -4,7 +4,7 @@ import { useTransition, animated } from 'react-spring'; import { css } from '@emotion/css'; import { AnimatedLoading } from '../icons/AnimatedLoading'; -import { useAppSelector } from '../redux'; +import { useSelector } from '../redux'; import { theme } from '../style'; import { Background } from './Background'; @@ -16,7 +16,7 @@ type AppBackgroundProps = { }; export function AppBackground({ isLoading }: AppBackgroundProps) { - const loadingText = useAppSelector(state => state.app.loadingText); + const loadingText = useSelector(state => state.app.loadingText); const showLoading = isLoading || loadingText !== null; const transitions = useTransition(loadingText, { from: { opacity: 0, transform: 'translateY(-100px)' }, diff --git a/packages/desktop-client/src/components/BankSyncStatus.tsx b/packages/desktop-client/src/components/BankSyncStatus.tsx index 657b99a03ad..843b62d3e3f 100644 --- a/packages/desktop-client/src/components/BankSyncStatus.tsx +++ b/packages/desktop-client/src/components/BankSyncStatus.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Trans } from 'react-i18next'; import { useTransition, animated } from 'react-spring'; -import { useAppSelector } from '../redux'; +import { useSelector } from '../redux'; import { theme, styles } from '../style'; import { AnimatedRefresh } from './AnimatedRefresh'; @@ -10,9 +10,7 @@ import { Text } from './common/Text'; import { View } from './common/View'; export function BankSyncStatus() { - const accountsSyncing = useAppSelector( - state => state.account.accountsSyncing, - ); + const accountsSyncing = useSelector(state => state.account.accountsSyncing); const accountsSyncingCount = accountsSyncing.length; const count = accountsSyncingCount; diff --git a/packages/desktop-client/src/components/FinancesApp.tsx b/packages/desktop-client/src/components/FinancesApp.tsx index 09dd4c3802c..dcbe3b9635a 100644 --- a/packages/desktop-client/src/components/FinancesApp.tsx +++ b/packages/desktop-client/src/components/FinancesApp.tsx @@ -16,7 +16,7 @@ import { useAccounts } from '../hooks/useAccounts'; import { useLocalPref } from '../hooks/useLocalPref'; import { useMetaThemeColor } from '../hooks/useMetaThemeColor'; import { useNavigate } from '../hooks/useNavigate'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; import { theme } from '../style'; import { getIsOutdated, getLatestVersion } from '../util/versions'; @@ -80,11 +80,11 @@ export function FinancesApp() { const { isNarrowWidth } = useResponsive(); useMetaThemeColor(isNarrowWidth ? theme.mobileViewTheme : null); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { t } = useTranslation(); const accounts = useAccounts(); - const accountsLoaded = useAppSelector(state => state.queries.accountsLoaded); + const accountsLoaded = useSelector(state => state.queries.accountsLoaded); const [lastUsedVersion, setLastUsedVersion] = useLocalPref( 'flags.updateNotificationShownForVersion', diff --git a/packages/desktop-client/src/components/HelpMenu.tsx b/packages/desktop-client/src/components/HelpMenu.tsx index ac33fb9cf93..11c292add30 100644 --- a/packages/desktop-client/src/components/HelpMenu.tsx +++ b/packages/desktop-client/src/components/HelpMenu.tsx @@ -10,7 +10,7 @@ import { pushModal } from 'loot-core/client/actions/modals'; import { useFeatureFlag } from '../hooks/useFeatureFlag'; import { SvgHelp } from '../icons/v2/Help'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; import { Button } from './common/Button2'; import { Menu } from './common/Menu'; @@ -52,7 +52,7 @@ export const HelpMenu = () => { const [isMenuOpen, toggleMenuOpen, setMenuOpen] = useToggle(); const menuButtonRef = useRef(null); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const page = useLocation().pathname; const handleItemSelect = (item: HelpMenuItem) => { diff --git a/packages/desktop-client/src/components/LoggedInUser.tsx b/packages/desktop-client/src/components/LoggedInUser.tsx index 4e6f431380c..463b5d6d861 100644 --- a/packages/desktop-client/src/components/LoggedInUser.tsx +++ b/packages/desktop-client/src/components/LoggedInUser.tsx @@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { closeBudget, getUserData, signOut } from 'loot-core/client/actions'; import { useNavigate } from '../hooks/useNavigate'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; import { theme, styles } from '../style'; import { Button } from './common/Button2'; @@ -26,9 +26,9 @@ export function LoggedInUser({ color, }: LoggedInUserProps) { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); - const userData = useAppSelector(state => state.user.data); + const userData = useSelector(state => state.user.data); const [loading, setLoading] = useState(true); const [menuOpen, setMenuOpen] = useState(false); const serverUrl = useServerURL(); diff --git a/packages/desktop-client/src/components/ManageRules.tsx b/packages/desktop-client/src/components/ManageRules.tsx index 9aacf2fbbf8..02778383720 100644 --- a/packages/desktop-client/src/components/ManageRules.tsx +++ b/packages/desktop-client/src/components/ManageRules.tsx @@ -24,7 +24,7 @@ import { useAccounts } from '../hooks/useAccounts'; import { useCategories } from '../hooks/useCategories'; import { usePayees } from '../hooks/usePayees'; import { useSelected, SelectedProvider } from '../hooks/useSelected'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; import { theme } from '../style'; import { Button } from './common/Button2'; @@ -113,7 +113,7 @@ export function ManageRules({ const [allRules, setAllRules] = useState([]); const [page, setPage] = useState(0); const [filter, setFilter] = useState(''); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { schedules = [] } = useSchedules({ query: useMemo(() => q('schedules').select('*'), []), diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx index 00c8b3c7e9a..3788d495582 100644 --- a/packages/desktop-client/src/components/Modals.tsx +++ b/packages/desktop-client/src/components/Modals.tsx @@ -9,7 +9,7 @@ import * as monthUtils from 'loot-core/src/shared/months'; import { useMetadataPref } from '../hooks/useMetadataPref'; import { useModalState } from '../hooks/useModalState'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; import { ModalTitle, ModalHeader } from './common/Modal'; import { AccountAutocompleteModal } from './modals/AccountAutocompleteModal'; @@ -73,7 +73,7 @@ import { NamespaceContext } from './spreadsheet/NamespaceContext'; export function Modals() { const location = useLocation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { modalStack } = useModalState(); const [budgetId] = useMetadataPref('id'); diff --git a/packages/desktop-client/src/components/Notifications.tsx b/packages/desktop-client/src/components/Notifications.tsx index bcfe12cb64e..dde728d7d9d 100644 --- a/packages/desktop-client/src/components/Notifications.tsx +++ b/packages/desktop-client/src/components/Notifications.tsx @@ -15,7 +15,7 @@ import type { NotificationWithId } from 'loot-core/src/client/state-types/notifi import { AnimatedLoading } from '../icons/AnimatedLoading'; import { SvgDelete } from '../icons/v0'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; import { styles, theme } from '../style'; import { Button, ButtonWithLoading } from './common/Button2'; @@ -262,12 +262,10 @@ function Notification({ } export function Notifications({ style }: { style?: CSSProperties }) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { isNarrowWidth } = useResponsive(); - const notifications = useAppSelector( - state => state.notifications.notifications, - ); - const notificationInset = useAppSelector(state => state.notifications.inset); + const notifications = useSelector(state => state.notifications.notifications); + const notificationInset = useSelector(state => state.notifications.inset); return ( state.app.updateInfo); - const showUpdateNotification = useAppSelector( + const updateInfo = useSelector(state => state.app.updateInfo); + const showUpdateNotification = useSelector( state => state.app.showUpdateNotification, ); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const onRestart = () => { dispatch(updateApp()); }; diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx index 12be08d43d6..75c2fe2819c 100644 --- a/packages/desktop-client/src/components/accounts/Account.tsx +++ b/packages/desktop-client/src/components/accounts/Account.tsx @@ -68,7 +68,7 @@ import { } from '../../hooks/useSplitsExpanded'; import { useSyncedPref } from '../../hooks/useSyncedPref'; import { useTransactionBatchActions } from '../../hooks/useTransactionBatchActions'; -import { useAppSelector } from '../../redux'; +import { useSelector } from '../../redux'; import { styles, theme } from '../../style'; import { Button } from '../common/Button2'; import { Text } from '../common/Text'; @@ -1860,10 +1860,8 @@ export function Account() { const location = useLocation(); const { grouped: categoryGroups } = useCategories(); - const newTransactions = useAppSelector( - state => state.queries.newTransactions, - ); - const matchedTransactions = useAppSelector( + const newTransactions = useSelector(state => state.queries.newTransactions); + const matchedTransactions = useSelector( state => state.queries.matchedTransactions, ); const accounts = useAccounts(); @@ -1884,12 +1882,8 @@ export function Account() { const [showExtraBalances, setShowExtraBalances] = useSyncedPref( `show-extra-balances-${params.id || 'all-accounts'}`, ); - const modalShowing = useAppSelector( - state => state.modals.modalStack.length > 0, - ); - const accountsSyncing = useAppSelector( - state => state.account.accountsSyncing, - ); + const modalShowing = useSelector(state => state.modals.modalStack.length > 0); + const accountsSyncing = useSelector(state => state.account.accountsSyncing); const filterConditions = location?.state?.filterConditions || []; const savedFiters = useFilters(); diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx b/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx index 9f8b00d215d..942ced0adf0 100644 --- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx +++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx @@ -9,7 +9,7 @@ import { authorizeBank } from '../../gocardless'; import { useAccounts } from '../../hooks/useAccounts'; import { useFailedAccounts } from '../../hooks/useFailedAccounts'; import { SvgExclamationOutline } from '../../icons/v1'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button } from '../common/Button2'; import { Link } from '../common/Link'; @@ -84,7 +84,7 @@ function useErrorMessage() { export function AccountSyncCheck() { const accounts = useAccounts(); const failedAccounts = useFailedAccounts(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { id } = useParams(); const [open, setOpen] = useState(false); const triggerRef = useRef(null); diff --git a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx index 5334e6e86d3..aa8043905b6 100644 --- a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx @@ -26,7 +26,7 @@ import { import { useAccounts } from '../../hooks/useAccounts'; import { useCommonPayees, usePayees } from '../../hooks/usePayees'; import { SvgAdd, SvgBookmark } from '../../icons/v1'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme, styles } from '../../style'; import { Button } from '../common/Button'; import { TextOneLine } from '../common/TextOneLine'; @@ -320,7 +320,7 @@ export function PayeeAutocomplete({ return [{ id: 'new', favorite: 0, name: '' }, ...filteredSuggestions]; }, [commonPayees, payees, focusTransferPayees, accounts, hasPayeeInput]); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); async function handleSelect(idOrIds, rawInputValue) { if (!clearOnBlur) { diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx index f57ed655702..f7b61070445 100644 --- a/packages/desktop-client/src/components/budget/index.tsx +++ b/packages/desktop-client/src/components/budget/index.tsx @@ -25,7 +25,7 @@ import { useGlobalPref } from '../../hooks/useGlobalPref'; import { useLocalPref } from '../../hooks/useLocalPref'; import { useNavigate } from '../../hooks/useNavigate'; import { useSyncedPref } from '../../hooks/useSyncedPref'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles } from '../../style'; import { View } from '../common/View'; import { NamespaceContext } from '../spreadsheet/NamespaceContext'; @@ -67,7 +67,7 @@ function BudgetInner(props: BudgetInnerProps) { const { t } = useTranslation(); const currentMonth = monthUtils.currentMonth(); const spreadsheet = useSpreadsheet(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); const [summaryCollapsed, setSummaryCollapsedPref] = useLocalPref( 'budget.summaryCollapsed', diff --git a/packages/desktop-client/src/components/manager/BudgetList.tsx b/packages/desktop-client/src/components/manager/BudgetList.tsx index b2ae6524f43..ce6cabdbfb5 100644 --- a/packages/desktop-client/src/components/manager/BudgetList.tsx +++ b/packages/desktop-client/src/components/manager/BudgetList.tsx @@ -33,7 +33,7 @@ import { SvgFileDouble, } from '../../icons/v1'; import { SvgCloudUnknown, SvgKey, SvgRefreshArrow } from '../../icons/v2'; -import { useAppSelector, useAppDispatch } from '../../redux'; +import { useSelector, useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { tokens } from '../../tokens'; import { Button } from '../common/Button2'; @@ -413,8 +413,8 @@ function BudgetListHeader({ } export function BudgetList({ showHeader = true, quickSwitchMode = false }) { - const dispatch = useAppDispatch(); - const allFiles = useAppSelector(state => state.budgets.allFiles || []); + const dispatch = useDispatch(); + const allFiles = useSelector(state => state.budgets.allFiles || []); const [id] = useMetadataPref('id'); // Remote files do not have the 'id' field diff --git a/packages/desktop-client/src/components/manager/ConfigServer.tsx b/packages/desktop-client/src/components/manager/ConfigServer.tsx index 60c9d835aa6..a8020f083dc 100644 --- a/packages/desktop-client/src/components/manager/ConfigServer.tsx +++ b/packages/desktop-client/src/components/manager/ConfigServer.tsx @@ -10,7 +10,7 @@ import { import { useGlobalPref } from '../../hooks/useGlobalPref'; import { useNavigate } from '../../hooks/useNavigate'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button, ButtonWithLoading } from '../common/Button2'; import { BigInput } from '../common/Input'; @@ -23,7 +23,7 @@ import { Title } from './subscribe/common'; export function ConfigServer() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); const [url, setUrl] = useState(''); const currentUrl = useServerURL(); diff --git a/packages/desktop-client/src/components/manager/ManagementApp.tsx b/packages/desktop-client/src/components/manager/ManagementApp.tsx index 2815b6bb53e..d830753be43 100644 --- a/packages/desktop-client/src/components/manager/ManagementApp.tsx +++ b/packages/desktop-client/src/components/manager/ManagementApp.tsx @@ -4,7 +4,7 @@ import { Navigate, Route, Routes } from 'react-router-dom'; import { loggedIn, setAppState } from 'loot-core/client/actions'; import { useMetaThemeColor } from '../../hooks/useMetaThemeColor'; -import { useAppSelector, useAppDispatch } from '../../redux'; +import { useSelector, useDispatch } from '../../redux'; import { theme } from '../../style'; import { tokens } from '../../tokens'; import { AppBackground } from '../AppBackground'; @@ -55,14 +55,14 @@ export function ManagementApp() { isNarrowWidth ? theme.mobileConfigServerViewTheme : undefined, ); - const files = useAppSelector(state => state.budgets.allFiles); - const isLoading = useAppSelector(state => state.app.loadingText !== null); - const userData = useAppSelector(state => state.user.data); - const managerHasInitialized = useAppSelector( + const files = useSelector(state => state.budgets.allFiles); + const isLoading = useSelector(state => state.app.loadingText !== null); + const userData = useSelector(state => state.user.data); + const managerHasInitialized = useSelector( state => state.app.managerHasInitialized, ); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); // runs on mount only useEffect(() => { diff --git a/packages/desktop-client/src/components/manager/WelcomeScreen.tsx b/packages/desktop-client/src/components/manager/WelcomeScreen.tsx index f2d64d6d845..7586402a78b 100644 --- a/packages/desktop-client/src/components/manager/WelcomeScreen.tsx +++ b/packages/desktop-client/src/components/manager/WelcomeScreen.tsx @@ -3,7 +3,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { createBudget, pushModal } from 'loot-core/client/actions'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { Button } from '../common/Button2'; import { Link } from '../common/Link'; @@ -13,7 +13,7 @@ import { View } from '../common/View'; export function WelcomeScreen() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); return ( state.account.accountsSyncing, - ); + const syncingAccountIds = useSelector(state => state.account.accountsSyncing); const pending = useMemo( () => syncingAccountIds.includes(account.id), [syncingAccountIds, account.id], @@ -109,7 +107,7 @@ function AccountHeader({ account }: { readonly account: AccountEntity }) { [failedAccounts, account.id], ); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const onSave = useCallback( (account: AccountEntity) => { @@ -253,7 +251,7 @@ function TransactionListWithPreviews({ }); const dateFormat = useDateFormat() || 'MM/dd/yyyy'; - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); const onRefresh = useCallback(() => { diff --git a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx index e12f878fcc8..3c84d66ac9d 100644 --- a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx +++ b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx @@ -11,7 +11,7 @@ import { useFailedAccounts } from '../../../hooks/useFailedAccounts'; import { useNavigate } from '../../../hooks/useNavigate'; import { useSyncedPref } from '../../../hooks/useSyncedPref'; import { SvgAdd } from '../../../icons/v1'; -import { useAppSelector, useAppDispatch } from '../../../redux'; +import { useSelector, useDispatch } from '../../../redux'; import { theme, styles } from '../../../style'; import { makeAmountFullStyle } from '../../budget/util'; import { Button } from '../../common/Button2'; @@ -198,9 +198,7 @@ function AccountList({ }: AccountListProps) { const { t } = useTranslation(); const failedAccounts = useFailedAccounts(); - const syncingAccountIds = useAppSelector( - state => state.account.accountsSyncing, - ); + const syncingAccountIds = useSelector(state => state.account.accountsSyncing); const onBudgetAccounts = accounts.filter(account => account.offbudget === 0); const offBudgetAccounts = accounts.filter(account => account.offbudget === 1); @@ -271,9 +269,9 @@ function AccountList({ } export function Accounts() { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const accounts = useAccounts(); - const updatedAccounts = useAppSelector( + const updatedAccounts = useSelector( (state: RootState) => state.queries.updatedAccounts, ); const [_numberFormat] = useSyncedPref('numberFormat'); diff --git a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx index d2ff3ade29a..c3976b39103 100644 --- a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx +++ b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx @@ -30,7 +30,7 @@ import { SvgCheveronRight, } from '../../../icons/v1'; import { SvgViewShow } from '../../../icons/v2'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme, styles } from '../../../style'; import { BalanceWithCarryover } from '../../budget/BalanceWithCarryover'; import { makeAmountGrey, makeBalanceAmountStyle } from '../../budget/util'; @@ -230,7 +230,7 @@ function BudgetCell({ }) { const { t } = useTranslation(); const columnWidth = getColumnWidth(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const format = useFormat(); const { showUndoNotification } = useUndo(); const [budgetType = 'rollover'] = useSyncedPref('budgetType'); @@ -408,7 +408,7 @@ const ExpenseCategory = memo(function ExpenseCategory({ const [budgetType = 'rollover'] = useSyncedPref('budgetType'); const modalBudgetType = budgetType === 'rollover' ? 'envelope' : 'tracking'; - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { showUndoNotification } = useUndo(); const { list: categories } = useCategories(); const categoriesById = groupById(categories); diff --git a/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx b/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx index 9626c6e9cfa..290f8c25fac 100644 --- a/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx +++ b/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx @@ -17,7 +17,7 @@ import { import { useDateFormat } from '../../../hooks/useDateFormat'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { TextOneLine } from '../../common/TextOneLine'; import { View } from '../../common/View'; import { MobilePageHeader, Page } from '../../Page'; @@ -34,7 +34,7 @@ export function CategoryTransactions({ category, month, }: CategoryTransactionsProps) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); const baseTransactionsQuery = useCallback( diff --git a/packages/desktop-client/src/components/mobile/budget/index.tsx b/packages/desktop-client/src/components/mobile/budget/index.tsx index bcec3e25233..9ff327e8853 100644 --- a/packages/desktop-client/src/components/mobile/budget/index.tsx +++ b/packages/desktop-client/src/components/mobile/budget/index.tsx @@ -24,7 +24,7 @@ import { useCategories } from '../../../hooks/useCategories'; import { useLocalPref } from '../../../hooks/useLocalPref'; import { useSyncedPref } from '../../../hooks/useSyncedPref'; import { AnimatedLoading } from '../../../icons/AnimatedLoading'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme } from '../../../style'; import { prewarmMonth } from '../../budget/util'; import { View } from '../../common/View'; @@ -55,7 +55,7 @@ export function Budget() { const [_numberFormat] = useSyncedPref('numberFormat'); const numberFormat = _numberFormat || 'comma-dot'; const [hideFraction] = useSyncedPref('hideFraction'); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); useEffect(() => { async function init() { diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx index c4852d5d852..ef3066469eb 100644 --- a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx +++ b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx @@ -54,7 +54,7 @@ import { import { SvgSplit } from '../../../icons/v0'; import { SvgAdd, SvgPiggyBank, SvgTrash } from '../../../icons/v1'; import { SvgPencilWriteAlternate } from '../../../icons/v2'; -import { useAppSelector, useAppDispatch } from '../../../redux'; +import { useSelector, useDispatch } from '../../../redux'; import { styles, theme } from '../../../style'; import { Button } from '../../common/Button'; import { Text } from '../../common/Text'; @@ -451,7 +451,7 @@ const TransactionEditInner = memo(function TransactionEditInner({ }) { const { t } = useTranslation(); const navigate = useNavigate(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const transactions = useMemo( () => unserializedTransactions.map(t => serializeTransaction(t, dateFormat)) || @@ -1022,7 +1022,7 @@ function TransactionEditUnconnected({ const { transactionId } = useParams(); const { state: locationState } = useLocation(); const navigate = useNavigate(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [transactions, setTransactions] = useState([]); const [fetchedTransactions, setFetchedTransactions] = useState([]); const isAdding = useRef(false); @@ -1246,9 +1246,7 @@ function TransactionEditUnconnected({ export const TransactionEdit = props => { const { list: categories } = useCategories(); const payees = usePayees(); - const lastTransaction = useAppSelector( - state => state.queries.lastTransaction, - ); + const lastTransaction = useSelector(state => state.queries.lastTransaction); const accounts = useAccounts(); const dateFormat = useDateFormat() || 'MM/dd/yyyy'; diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx b/packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx index d3e57533ea3..cf555dba3bb 100644 --- a/packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx +++ b/packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx @@ -26,7 +26,7 @@ import { useUndo } from '../../../hooks/useUndo'; import { AnimatedLoading } from '../../../icons/AnimatedLoading'; import { SvgDelete } from '../../../icons/v0'; import { SvgDotsHorizontalTriple } from '../../../icons/v1'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { styles, theme } from '../../../style'; import { Button } from '../../common/Button2'; import { Menu } from '../../common/Menu'; @@ -246,7 +246,7 @@ function SelectedTransactionsFloatingActionBar({ transactions, style }) { const { list: categories } = useCategories(); const categoriesById = useMemo(() => groupById(categories), [categories]); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); useEffect(() => { dispatch(setNotificationInset({ bottom: NOTIFICATION_BOTTOM_INSET })); return () => { diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx index 90cc5ad9fb7..dee30eddf0d 100644 --- a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx +++ b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx @@ -24,7 +24,7 @@ import { SvgCheckCircle1, SvgLockClosed, } from '../../../icons/v2'; -import { useAppSelector } from '../../../redux'; +import { useSelector } from '../../../redux'; import { styles, theme } from '../../../style'; import { makeAmountFullStyle } from '../../budget/util'; import { Button } from '../../common/Button2'; @@ -59,9 +59,7 @@ export function TransactionListItem({ const transferAccount = useAccount(payee?.transfer_acct || ''); const isPreview = isPreviewId(transaction?.id || ''); - const newTransactions = useAppSelector( - state => state.queries.newTransactions, - ); + const newTransactions = useSelector(state => state.queries.newTransactions); const { longPressProps } = useLongPress({ accessibilityDescription: 'Long press to select multiple transactions', diff --git a/packages/desktop-client/src/components/modals/BudgetListModal.tsx b/packages/desktop-client/src/components/modals/BudgetListModal.tsx index 2fb8f674ee1..1d1d5fc77f5 100644 --- a/packages/desktop-client/src/components/modals/BudgetListModal.tsx +++ b/packages/desktop-client/src/components/modals/BudgetListModal.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { useMetadataPref } from '../../hooks/useMetadataPref'; -import { useAppSelector } from '../../redux'; +import { useSelector } from '../../redux'; import { Modal, ModalHeader, ModalCloseButton } from '../common/Modal'; import { Text } from '../common/Text'; import { View } from '../common/View'; @@ -11,7 +11,7 @@ import { BudgetList } from '../manager/BudgetList'; export function BudgetListModal() { const { t } = useTranslation(); const [id] = useMetadataPref('id'); - const currentFile = useAppSelector(state => + const currentFile = useSelector(state => state.budgets.allFiles?.find(f => 'id' in f && f.id === id), ); diff --git a/packages/desktop-client/src/components/modals/CloseAccountModal.tsx b/packages/desktop-client/src/components/modals/CloseAccountModal.tsx index 80c860424ce..82e97f5e25e 100644 --- a/packages/desktop-client/src/components/modals/CloseAccountModal.tsx +++ b/packages/desktop-client/src/components/modals/CloseAccountModal.tsx @@ -13,7 +13,7 @@ import { type AccountEntity } from 'loot-core/src/types/models'; import { useAccounts } from '../../hooks/useAccounts'; import { useCategories } from '../../hooks/useCategories'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete'; @@ -61,7 +61,7 @@ export function CloseAccountModal({ const [transferError, setTransferError] = useState(false); const [categoryError, setCategoryError] = useState(false); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { isNarrowWidth } = useResponsive(); const onSelectAccount = accId => { diff --git a/packages/desktop-client/src/components/modals/CoverModal.tsx b/packages/desktop-client/src/components/modals/CoverModal.tsx index ec8aa7cb0d1..8123d80f8f4 100644 --- a/packages/desktop-client/src/components/modals/CoverModal.tsx +++ b/packages/desktop-client/src/components/modals/CoverModal.tsx @@ -5,7 +5,7 @@ import { pushModal } from 'loot-core/client/actions'; import { type CategoryEntity } from 'loot-core/src/types/models'; import { useCategories } from '../../hooks/useCategories'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles } from '../../style'; import { addToBeBudgetedGroup, @@ -49,7 +49,7 @@ export function CoverModal({ }, [categoryId, originalCategoryGroups, showToBeBudgeted]); const [fromCategoryId, setFromCategoryId] = useState(null); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const onCategoryClick = useCallback(() => { dispatch( diff --git a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx index e8cbac89d50..5f8eec67be5 100644 --- a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx +++ b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx @@ -10,7 +10,7 @@ import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus'; import { useSimpleFinStatus } from '../../hooks/useSimpleFinStatus'; import { useSyncServerStatus } from '../../hooks/useSyncServerStatus'; import { SvgDotsHorizontalTriple } from '../../icons/v1'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button, ButtonWithLoading } from '../common/Button2'; import { InitialFocus } from '../common/InitialFocus'; @@ -29,7 +29,7 @@ type CreateAccountProps = { export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { const { t } = useTranslation(); const syncServerStatus = useSyncServerStatus(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] = useState< boolean | null >(null); diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx b/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx index ae95ac9bd23..b90a0e0923d 100644 --- a/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx +++ b/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx @@ -9,7 +9,7 @@ import { loadAllFiles, loadGlobalPrefs, sync } from 'loot-core/client/actions'; import { send } from 'loot-core/src/platform/client/fetch'; import { getCreateKeyError } from 'loot-core/src/shared/errors'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { ButtonWithLoading } from '../common/Button2'; import { InitialFocus } from '../common/InitialFocus'; @@ -41,7 +41,7 @@ export function CreateEncryptionKeyModal({ const [error, setError] = useState(''); const [showPassword, setShowPassword] = useState(false); const { isNarrowWidth } = useResponsive(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const isRecreating = options.recreate; diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx index 273593ba553..72e2e386192 100644 --- a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx +++ b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx @@ -8,7 +8,7 @@ import { toRelaxedNumber } from 'loot-core/src/shared/util'; import * as useAccounts from '../../hooks/useAccounts'; import { useNavigate } from '../../hooks/useNavigate'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button } from '../common/Button2'; import { FormError } from '../common/FormError'; @@ -31,7 +31,7 @@ import { validateAccountName } from '../util/accountValidation'; export function CreateLocalAccountModal() { const { t } = useTranslation(); const navigate = useNavigate(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const accounts = useAccounts.useAccounts(); const [name, setName] = useState(''); const [offbudget, setOffbudget] = useState(false); diff --git a/packages/desktop-client/src/components/modals/EditRuleModal.jsx b/packages/desktop-client/src/components/modals/EditRuleModal.jsx index d935c01d770..db4b70f86fc 100644 --- a/packages/desktop-client/src/components/modals/EditRuleModal.jsx +++ b/packages/desktop-client/src/components/modals/EditRuleModal.jsx @@ -36,7 +36,7 @@ import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { useSelected, SelectedProvider } from '../../hooks/useSelected'; import { SvgDelete, SvgAdd, SvgSubtract } from '../../icons/v0'; import { SvgAlignLeft, SvgCode, SvgInformationOutline } from '../../icons/v1'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { Button } from '../common/Button2'; import { Menu } from '../common/Menu'; @@ -784,7 +784,7 @@ export function EditRuleModal({ defaultRule, onSave: originalOnSave }) { const [stage, setStage] = useState(defaultRule.stage); const [conditionsOp, setConditionsOp] = useState(defaultRule.conditionsOp); const [transactions, setTransactions] = useState([]); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const scrollableEl = useRef(); const isSchedule = getActions(actionSplits).some( diff --git a/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx b/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx index 022f96fb01a..b22ed2a4573 100644 --- a/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx +++ b/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx @@ -8,7 +8,7 @@ import { format, sheetForMonth, prevMonth } from 'loot-core/src/shared/months'; import { useCategories } from '../../hooks/useCategories'; import { useUndo } from '../../hooks/useUndo'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles } from '../../style'; import { ToBudgetAmount } from '../budget/envelope/budgetsummary/ToBudgetAmount'; import { TotalsList } from '../budget/envelope/budgetsummary/TotalsList'; @@ -25,7 +25,7 @@ export function EnvelopeBudgetSummaryModal({ month, onBudgetAction, }: EnvelopeBudgetSummaryModalProps) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const prevMonthName = format(prevMonth(month), 'MMM'); const sheetValue = useEnvelopeSheetValue({ diff --git a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx index a270fbc2bfc..bc32e78cd43 100644 --- a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx +++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx @@ -11,7 +11,7 @@ import { import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus'; import { AnimatedLoading } from '../../icons/AnimatedLoading'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Error, Warning } from '../alerts'; import { Autocomplete } from '../autocomplete/Autocomplete'; @@ -87,7 +87,7 @@ export function GoCardlessExternalMsgModal({ }: GoCardlessExternalMsgProps) { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [waiting, setWaiting] = useState(null); const [success, setSuccess] = useState(false); diff --git a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx index 1eb5b2c0859..9c1092ef96a 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx +++ b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx @@ -13,7 +13,7 @@ import { amountToInteger } from 'loot-core/src/shared/util'; import { useDateFormat } from '../../../hooks/useDateFormat'; import { useSyncedPrefs } from '../../../hooks/useSyncedPrefs'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme } from '../../../style'; import { Button, ButtonWithLoading } from '../../common/Button2'; import { Input } from '../../common/Input'; @@ -144,7 +144,7 @@ export function ImportTransactionsModal({ options }) { const { t } = useTranslation(); const dateFormat = useDateFormat() || 'MM/dd/yyyy'; const [prefs, savePrefs] = useSyncedPrefs(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [multiplierAmount, setMultiplierAmount] = useState(''); const [loadingState, setLoadingState] = useState('parsing'); diff --git a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx index dbc0eb6935c..0b483b6befd 100644 --- a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx +++ b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx @@ -6,7 +6,7 @@ import { type Backup } from 'loot-core/server/backups'; import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch'; import { useMetadataPref } from '../../hooks/useMetadataPref'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Block } from '../common/Block'; import { Button } from '../common/Button2'; @@ -52,7 +52,7 @@ export function LoadBackupModal({ watchUpdates, backupDisabled, }: LoadBackupModalProps) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [backups, setBackups] = useState([]); const [prefsBudgetId] = useMetadataPref('id'); const budgetIdToLoad = budgetId ?? prefsBudgetId; diff --git a/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx b/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx index cd32d62d711..4a22fbfefdd 100644 --- a/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx +++ b/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx @@ -6,7 +6,7 @@ import { send } from 'loot-core/src/platform/client/fetch'; import { type PayeeEntity } from 'loot-core/types/models'; import { usePayees } from '../../hooks/usePayees'; -import { useAppSelector, useAppDispatch } from '../../redux'; +import { useSelector, useDispatch } from '../../redux'; import { theme } from '../../style'; import { Information } from '../alerts'; import { Button } from '../common/Button2'; @@ -28,9 +28,9 @@ export function MergeUnusedPayeesModal({ }: MergeUnusedPayeesModalProps) { const { t } = useTranslation(); const allPayees = usePayees(); - const modalStack = useAppSelector(state => state.modals.modalStack); + const modalStack = useSelector(state => state.modals.modalStack); const isEditingRule = !!modalStack.find(m => m.name === 'edit-rule'); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [shouldCreateRule, setShouldCreateRule] = useState(true); const flashRef = useRef(null); diff --git a/packages/desktop-client/src/components/modals/OutOfSyncMigrationsModal.tsx b/packages/desktop-client/src/components/modals/OutOfSyncMigrationsModal.tsx index 2461da9cc9b..2a904f26345 100644 --- a/packages/desktop-client/src/components/modals/OutOfSyncMigrationsModal.tsx +++ b/packages/desktop-client/src/components/modals/OutOfSyncMigrationsModal.tsx @@ -3,7 +3,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { closeBudget } from 'loot-core/client/actions'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { Button } from '../common/Button2'; import { Link } from '../common/Link'; import { Modal, ModalHeader, ModalTitle } from '../common/Modal'; @@ -12,7 +12,7 @@ import { Text } from '../common/Text'; import { View } from '../common/View'; export function OutOfSyncMigrationsModal() { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { t } = useTranslation(); diff --git a/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx b/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx index f3101b06288..66f8aa87981 100644 --- a/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx +++ b/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx @@ -9,7 +9,7 @@ import { } from 'loot-core/client/actions'; import { useAccounts } from '../../hooks/useAccounts'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Autocomplete } from '../autocomplete/Autocomplete'; import { Button } from '../common/Button2'; @@ -32,7 +32,7 @@ export function SelectLinkedAccountsModal({ }) { externalAccounts.sort((a, b) => a.name.localeCompare(b.name)); const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const localAccounts = useAccounts().filter(a => a.closed === 0); const [chosenAccounts, setChosenAccounts] = useState(() => { return Object.fromEntries( diff --git a/packages/desktop-client/src/components/modals/TransferModal.tsx b/packages/desktop-client/src/components/modals/TransferModal.tsx index a0dff11bfea..9cf1a7fa64b 100644 --- a/packages/desktop-client/src/components/modals/TransferModal.tsx +++ b/packages/desktop-client/src/components/modals/TransferModal.tsx @@ -5,7 +5,7 @@ import { pushModal } from 'loot-core/client/actions'; import { type CategoryEntity } from 'loot-core/types/models'; import { useCategories } from '../../hooks/useCategories'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles } from '../../style'; import { addToBeBudgetedGroup, @@ -55,7 +55,7 @@ export function TransferModal({ const [amount, setAmount] = useState(0); const [toCategoryId, setToCategoryId] = useState(null); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const openCategoryModal = () => { dispatch( diff --git a/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx b/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx index ce42775688b..adf3e5dfe35 100644 --- a/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx +++ b/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx @@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { addNotification } from 'loot-core/client/actions'; import { useGlobalPref } from '../../../hooks/useGlobalPref'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme, styles } from '../../../style'; import { Information } from '../../alerts'; import { Button, ButtonWithLoading } from '../../common/Button2'; @@ -48,7 +48,7 @@ export function ConfirmChangeDocumentDirModal({ const [loading, setLoading] = useState(false); const [moveFiles, setMoveFiles] = useState(false); const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const restartElectronServer = useCallback(() => { globalThis.window.Actual?.restartElectronServer(); diff --git a/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx b/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx index 3c482d43744..2524c0e4d1d 100644 --- a/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx @@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { deleteBudget } from 'loot-core/client/actions'; import { type File } from 'loot-core/src/types/file'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme } from '../../../style'; import { ButtonWithLoading } from '../../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal'; @@ -22,7 +22,7 @@ export function DeleteFileModal({ file }: DeleteFileProps) { // user. The current user should be able to delete the local file, // but not the remote one const isCloudFile = 'cloudFileId' in file && file.state !== 'broken'; - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [loadingState, setLoadingState] = useState<'cloud' | 'local' | null>( null, diff --git a/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx b/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx index cde48c084e0..c5ecc286c23 100644 --- a/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx @@ -9,7 +9,7 @@ import { } from 'loot-core/client/actions'; import { type File } from 'loot-core/src/types/file'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme } from '../../../style'; import { Button, ButtonWithLoading } from '../../common/Button2'; import { FormError } from '../../common/FormError'; @@ -49,7 +49,7 @@ export function DuplicateFileModal({ // If the state is "broken" that means it was created by another user. const isCloudFile = 'cloudFileId' in file && file.state !== 'broken'; const isLocalFile = 'id' in file; - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [loadingState, setLoadingState] = useState<'cloud' | 'local' | null>( null, diff --git a/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx b/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx index 5b283335dcc..ee3c1107def 100644 --- a/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx @@ -5,7 +5,7 @@ import { loadAllFiles, pushModal } from 'loot-core/client/actions'; import { useGlobalPref } from '../../../hooks/useGlobalPref'; import { SvgPencil1 } from '../../../icons/v2'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme, styles } from '../../../style'; import { Button } from '../../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal'; @@ -16,7 +16,7 @@ function FileLocationSettings() { const [documentDir, _setDocumentDirPref] = useGlobalPref('documentDir'); const [_documentDirChanged, setDirChanged] = useState(false); const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); async function onChooseDocumentDir() { const chosenDirectory = await window.Actual?.openFileDialog({ @@ -142,7 +142,7 @@ function SelfSignedCertLocationSettings() { } export function FilesSettingsModal() { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); function closeModal(close: () => void) { dispatch(loadAllFiles()); diff --git a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx index b086049f819..995154b13e7 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx @@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { importBudget } from 'loot-core/src/client/actions/budgets'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { styles, theme } from '../../../style'; import { Block } from '../../common/Block'; import { ButtonWithLoading } from '../../common/Button2'; @@ -33,7 +33,7 @@ function getErrorMessage(error: string): string { export function ImportActualModal() { const { t } = useTranslation(); const navigate = useNavigate(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [error, setError] = useState(null); const [importing, setImporting] = useState(false); diff --git a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx index 62bde0e91a0..ef4d1824f05 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx @@ -3,7 +3,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { pushModal } from 'loot-core/client/actions'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { styles, theme } from '../../../style'; import { Block } from '../../common/Block'; import { Button } from '../../common/Button2'; @@ -23,7 +23,7 @@ function getErrorMessage(error: 'not-ynab4' | boolean) { export function ImportModal() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [error] = useState(false); function onSelectType(type: 'ynab4' | 'ynab5' | 'actual') { diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx index b59ed31c079..49a80721bf9 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx @@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { importBudget } from 'loot-core/src/client/actions/budgets'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { styles, theme } from '../../../style'; import { Block } from '../../common/Block'; import { ButtonWithLoading } from '../../common/Button2'; @@ -25,7 +25,7 @@ function getErrorMessage(error: string): string { export function ImportYNAB4Modal() { const { t } = useTranslation(); const navigate = useNavigate(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [error, setError] = useState(null); const [importing, setImporting] = useState(false); diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx index cbf2e24bc18..8945278e80a 100644 --- a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx +++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx @@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { importBudget } from 'loot-core/src/client/actions/budgets'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { styles, theme } from '../../../style'; import { Block } from '../../common/Block'; import { ButtonWithLoading } from '../../common/Button2'; @@ -28,7 +28,7 @@ function getErrorMessage(error: string): string { export function ImportYNAB5Modal() { const { t } = useTranslation(); const navigate = useNavigate(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [error, setError] = useState(null); const [importing, setImporting] = useState(false); diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx b/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx index fc075bb7f8d..7ccf5b12c6b 100644 --- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx +++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx @@ -12,7 +12,7 @@ import { applyChanges, type Diff } from 'loot-core/src/shared/util'; import { type NewRuleEntity, type PayeeEntity } from 'loot-core/types/models'; import { usePayees } from '../../hooks/usePayees'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { ManagePayees } from './ManagePayees'; @@ -24,7 +24,7 @@ export function ManagePayeesWithData({ initialSelectedIds, }: ManagePayeesWithDataProps) { const payees = usePayees(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [ruleCounts, setRuleCounts] = useState({ value: new Map() }); const [orphans, setOrphans] = useState([]); diff --git a/packages/desktop-client/src/components/reports/Overview.tsx b/packages/desktop-client/src/components/reports/Overview.tsx index 7820a03d359..9aeb8d5a4e0 100644 --- a/packages/desktop-client/src/components/reports/Overview.tsx +++ b/packages/desktop-client/src/components/reports/Overview.tsx @@ -21,7 +21,7 @@ import { import { useAccounts } from '../../hooks/useAccounts'; import { useNavigate } from '../../hooks/useNavigate'; import { useSyncedPref } from '../../hooks/useSyncedPref'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { breakpoints } from '../../tokens'; import { Button } from '../common/Button2'; import { Menu } from '../common/Menu'; @@ -51,7 +51,7 @@ function isCustomReportWidget(widget: Widget): widget is CustomReportWidget { export function Overview() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [_firstDayOfWeekIdx] = useSyncedPref('firstDayOfWeekIdx'); const firstDayOfWeekIdx = _firstDayOfWeekIdx || '0'; diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx index 6af86242864..9ec6af671fc 100644 --- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx +++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx @@ -17,7 +17,7 @@ import { import { useFilters } from '../../../hooks/useFilters'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme } from '../../../style'; import { AlignedText } from '../../common/AlignedText'; import { Block } from '../../common/Block'; @@ -63,7 +63,7 @@ type CashFlowInnerProps = { }; function CashFlowInner({ widget }: CashFlowInnerProps) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { t } = useTranslation(); const { diff --git a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx index c7d488bdd51..9e3cd39b3a7 100644 --- a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx +++ b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx @@ -12,7 +12,7 @@ import { useCategories } from '../../../hooks/useCategories'; import { usePayees } from '../../../hooks/usePayees'; import { useSyncedPref } from '../../../hooks/useSyncedPref'; import { SvgExclamationSolid } from '../../../icons/v1'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { styles } from '../../../style/index'; import { theme } from '../../../style/theme'; import { Text } from '../../common/Text'; @@ -64,7 +64,7 @@ function CustomReportListCardsInner({ }: Omit & { report: CustomReportEntity; }) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [nameMenuOpen, setNameMenuOpen] = useState(false); const [earliestTransaction, setEarliestTransaction] = useState(''); diff --git a/packages/desktop-client/src/components/reports/reports/NetWorth.tsx b/packages/desktop-client/src/components/reports/reports/NetWorth.tsx index b84b22da8e3..4a98992969c 100644 --- a/packages/desktop-client/src/components/reports/reports/NetWorth.tsx +++ b/packages/desktop-client/src/components/reports/reports/NetWorth.tsx @@ -14,7 +14,7 @@ import { type TimeFrame, type NetWorthWidget } from 'loot-core/types/models'; import { useAccounts } from '../../../hooks/useAccounts'; import { useFilters } from '../../../hooks/useFilters'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme, styles } from '../../../style'; import { Button } from '../../common/Button2'; import { Paragraph } from '../../common/Paragraph'; @@ -52,7 +52,7 @@ type NetWorthInnerProps = { }; function NetWorthInner({ widget }: NetWorthInnerProps) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { t } = useTranslation(); const accounts = useAccounts(); diff --git a/packages/desktop-client/src/components/reports/reports/Spending.tsx b/packages/desktop-client/src/components/reports/reports/Spending.tsx index 0d985d41c3c..a97fc15a2e5 100644 --- a/packages/desktop-client/src/components/reports/reports/Spending.tsx +++ b/packages/desktop-client/src/components/reports/reports/Spending.tsx @@ -14,7 +14,7 @@ import { type RuleConditionEntity } from 'loot-core/types/models/rule'; import { useFilters } from '../../../hooks/useFilters'; import { useNavigate } from '../../../hooks/useNavigate'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme, styles } from '../../../style'; import { AlignedText } from '../../common/AlignedText'; import { Block } from '../../common/Block'; @@ -60,7 +60,7 @@ type SpendingInternalProps = { }; function SpendingInternal({ widget }: SpendingInternalProps) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const { t } = useTranslation(); const { diff --git a/packages/desktop-client/src/components/reports/reports/Summary.tsx b/packages/desktop-client/src/components/reports/reports/Summary.tsx index b2cf46a096a..1d7e5200edf 100644 --- a/packages/desktop-client/src/components/reports/reports/Summary.tsx +++ b/packages/desktop-client/src/components/reports/reports/Summary.tsx @@ -21,7 +21,7 @@ import { SvgEquals } from '../../../icons/v1'; import { SvgCloseParenthesis } from '../../../icons/v2/CloseParenthesis'; import { SvgOpenParenthesis } from '../../../icons/v2/OpenParenthesis'; import { SvgSum } from '../../../icons/v2/Sum'; -import { useAppDispatch } from '../../../redux'; +import { useDispatch } from '../../../redux'; import { theme } from '../../../style'; import { Button } from '../../common/Button2'; import { Text } from '../../common/Text'; @@ -176,7 +176,7 @@ function SummaryInner({ widget }: SummaryInnerProps) { run(); }, []); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); const { isNarrowWidth } = useResponsive(); const title = widget?.meta?.name || t('Summary'); diff --git a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx index ca53af4c773..47e9e70c4f3 100644 --- a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx +++ b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx @@ -7,7 +7,7 @@ import { send } from 'loot-core/src/platform/client/fetch'; import { type PayeeEntity } from 'loot-core/types/models'; import { useFormatList } from '../../hooks/useFormatList'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button } from '../common/Button2'; import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal'; @@ -20,7 +20,7 @@ export function PostsOfflineNotification() { const { t, i18n } = useTranslation(); const location = useLocation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const locationState = location.state; const payees = diff --git a/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx b/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx index 989b1593b50..0373855d8fb 100644 --- a/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx +++ b/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx @@ -14,7 +14,7 @@ import { extractScheduleConds } from 'loot-core/src/shared/schedules'; import { useDateFormat } from '../../hooks/useDateFormat'; import { usePayees } from '../../hooks/usePayees'; import { useSelected, SelectedProvider } from '../../hooks/useSelected'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; import { PayeeAutocomplete } from '../autocomplete/PayeeAutocomplete'; @@ -79,7 +79,7 @@ export function ScheduleDetails({ id, transaction }) { const adding = id == null; const fromTrans = transaction != null; const payees = getPayeesById(usePayees()); - const globalDispatch = useAppDispatch(); + const globalDispatch = useDispatch(); const dateFormat = useDateFormat() || 'MM/dd/yyyy'; const [state, dispatch] = useReducer( diff --git a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx index 6e7e3f12cb4..773d460c05d 100644 --- a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx +++ b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx @@ -12,7 +12,7 @@ import { } from 'loot-core/src/types/models'; import { SvgAdd } from '../../icons/v0'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { Button } from '../common/Button2'; import { InitialFocus } from '../common/InitialFocus'; import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal'; @@ -35,7 +35,7 @@ export function ScheduleLink({ }) { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [filter, setFilter] = useState(accountName || ''); const schedulesQuery = useMemo( () => q('schedules').filter({ completed: false }).select('*'), diff --git a/packages/desktop-client/src/components/schedules/index.tsx b/packages/desktop-client/src/components/schedules/index.tsx index 1d783a65b13..e3f39cd1e92 100644 --- a/packages/desktop-client/src/components/schedules/index.tsx +++ b/packages/desktop-client/src/components/schedules/index.tsx @@ -7,7 +7,7 @@ import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { send } from 'loot-core/src/platform/client/fetch'; import { type ScheduleEntity } from 'loot-core/src/types/models'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button } from '../common/Button2'; import { Search } from '../common/Search'; @@ -20,7 +20,7 @@ import { type ScheduleItemAction, SchedulesTable } from './SchedulesTable'; export function Schedules() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [filter, setFilter] = useState(''); const onEdit = useCallback( diff --git a/packages/desktop-client/src/components/settings/Encryption.tsx b/packages/desktop-client/src/components/settings/Encryption.tsx index 16abfe89fa1..2dfeab665db 100644 --- a/packages/desktop-client/src/components/settings/Encryption.tsx +++ b/packages/desktop-client/src/components/settings/Encryption.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'; import { pushModal } from 'loot-core/client/actions'; import { useMetadataPref } from '../../hooks/useMetadataPref'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button } from '../common/Button2'; import { Link } from '../common/Link'; @@ -15,7 +15,7 @@ import { Setting } from './UI'; export function EncryptionSettings() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const serverURL = useServerURL(); const [encryptKeyId] = useMetadataPref('encryptKeyId'); diff --git a/packages/desktop-client/src/components/settings/Reset.tsx b/packages/desktop-client/src/components/settings/Reset.tsx index 84ff54c6519..a6f7a21c0fe 100644 --- a/packages/desktop-client/src/components/settings/Reset.tsx +++ b/packages/desktop-client/src/components/settings/Reset.tsx @@ -5,7 +5,7 @@ import { resetSync } from 'loot-core/client/actions'; import { send } from 'loot-core/src/platform/client/fetch'; import { useMetadataPref } from '../../hooks/useMetadataPref'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { ButtonWithLoading } from '../common/Button2'; import { Text } from '../common/Text'; @@ -43,7 +43,7 @@ export function ResetSync() { const { t } = useTranslation(); const [groupId] = useMetadataPref('groupId'); const isEnabled = !!groupId; - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [resetting, setResetting] = useState(false); diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx index 5b1973796ce..d7cc65fc478 100644 --- a/packages/desktop-client/src/components/settings/index.tsx +++ b/packages/desktop-client/src/components/settings/index.tsx @@ -10,7 +10,7 @@ import { listen } from 'loot-core/src/platform/client/fetch'; import { useGlobalPref } from '../../hooks/useGlobalPref'; import { useIsOutdated, useLatestVersion } from '../../hooks/useLatestVersion'; import { useMetadataPref } from '../../hooks/useMetadataPref'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { tokens } from '../../tokens'; import { Button } from '../common/Button2'; @@ -130,7 +130,7 @@ export function Settings() { const { t } = useTranslation(); const [floatingSidebar] = useGlobalPref('floatingSidebar'); const [budgetName] = useMetadataPref('budgetName'); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const onCloseBudget = () => { dispatch(closeBudget()); diff --git a/packages/desktop-client/src/components/sidebar/Accounts.tsx b/packages/desktop-client/src/components/sidebar/Accounts.tsx index d05e90b74dc..b260c155553 100644 --- a/packages/desktop-client/src/components/sidebar/Accounts.tsx +++ b/packages/desktop-client/src/components/sidebar/Accounts.tsx @@ -12,7 +12,7 @@ import { useLocalPref } from '../../hooks/useLocalPref'; import { useOffBudgetAccounts } from '../../hooks/useOffBudgetAccounts'; import { useOnBudgetAccounts } from '../../hooks/useOnBudgetAccounts'; import { useUpdatedAccounts } from '../../hooks/useUpdatedAccounts'; -import { useAppSelector, useAppDispatch } from '../../redux'; +import { useSelector, useDispatch } from '../../redux'; import { theme } from '../../style'; import { View } from '../common/View'; @@ -23,7 +23,7 @@ const fontWeight = 600; export function Accounts() { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const [isDragging, setIsDragging] = useState(false); const accounts = useAccounts(); const failedAccounts = useFailedAccounts(); @@ -31,9 +31,7 @@ export function Accounts() { const offbudgetAccounts = useOffBudgetAccounts(); const onBudgetAccounts = useOnBudgetAccounts(); const closedAccounts = useClosedAccounts(); - const syncingAccountIds = useAppSelector( - state => state.account.accountsSyncing, - ); + const syncingAccountIds = useSelector(state => state.account.accountsSyncing); const getAccountPath = (account: AccountEntity) => `/accounts/${account.id}`; diff --git a/packages/desktop-client/src/components/sidebar/BudgetName.tsx b/packages/desktop-client/src/components/sidebar/BudgetName.tsx index 74a0e7312da..2f6fd8ea038 100644 --- a/packages/desktop-client/src/components/sidebar/BudgetName.tsx +++ b/packages/desktop-client/src/components/sidebar/BudgetName.tsx @@ -7,7 +7,7 @@ import * as Platform from 'loot-core/src/client/platform'; import { useMetadataPref } from '../../hooks/useMetadataPref'; import { useNavigate } from '../../hooks/useNavigate'; import { SvgExpandArrow } from '../../icons/v0'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { Button } from '../common/Button2'; import { InitialFocus } from '../common/InitialFocus'; @@ -52,7 +52,7 @@ export function BudgetName({ children }: BudgetNameProps) { function EditableBudgetName() { const { t } = useTranslation(); const [budgetName, setBudgetNamePref] = useMetadataPref('budgetName'); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const navigate = useNavigate(); const [menuOpen, setMenuOpen] = useState(false); const triggerRef = useRef(null); diff --git a/packages/desktop-client/src/components/sidebar/Sidebar.tsx b/packages/desktop-client/src/components/sidebar/Sidebar.tsx index 4fe53e3096b..d7d5394424b 100644 --- a/packages/desktop-client/src/components/sidebar/Sidebar.tsx +++ b/packages/desktop-client/src/components/sidebar/Sidebar.tsx @@ -11,7 +11,7 @@ import { useGlobalPref } from '../../hooks/useGlobalPref'; import { useLocalPref } from '../../hooks/useLocalPref'; import { useResizeObserver } from '../../hooks/useResizeObserver'; import { SvgAdd } from '../../icons/v1'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { View } from '../common/View'; import { useResponsive } from '../responsive/ResponsiveProvider'; @@ -27,7 +27,7 @@ export function Sidebar() { const hasWindowButtons = !Platform.isBrowser && Platform.OS === 'mac'; const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const sidebar = useSidebar(); const { width } = useResponsive(); const [isFloating = false, setFloatingSidebarPref] = diff --git a/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx b/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx index cc99c21bd7f..f11325572a8 100644 --- a/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx +++ b/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx @@ -8,7 +8,7 @@ import { validForTransfer } from 'loot-core/src/client/transfer'; import { type TransactionEntity } from 'loot-core/types/models'; import { useSelectedItems } from '../../hooks/useSelected'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { Menu } from '../common/Menu'; import { SelectedItemsButton } from '../table'; @@ -57,7 +57,7 @@ export function SelectedTransactionsButton({ onMakeAsNonSplitTransactions, }: SelectedTransactionsButtonProps) { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const selectedItems = useSelectedItems(); const selectedIds = useMemo(() => [...selectedItems], [selectedItems]); diff --git a/packages/desktop-client/src/components/transactions/TransactionList.jsx b/packages/desktop-client/src/components/transactions/TransactionList.jsx index 47ceb0ac9ea..89b67068750 100644 --- a/packages/desktop-client/src/components/transactions/TransactionList.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionList.jsx @@ -12,7 +12,7 @@ import { import { getChangedValues, applyChanges } from 'loot-core/src/shared/util'; import { useNavigate } from '../../hooks/useNavigate'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { theme } from '../../style'; import { TransactionTable } from './TransactionsTable'; @@ -98,7 +98,7 @@ export function TransactionList({ onScheduleAction, onMakeAsNonSplitTransactions, }) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const transactionsLatest = useRef(); const navigate = useNavigate(); diff --git a/packages/desktop-client/src/components/transactions/TransactionMenu.tsx b/packages/desktop-client/src/components/transactions/TransactionMenu.tsx index 3d78a37dc29..1d87d30a4df 100644 --- a/packages/desktop-client/src/components/transactions/TransactionMenu.tsx +++ b/packages/desktop-client/src/components/transactions/TransactionMenu.tsx @@ -5,7 +5,7 @@ import { pushModal } from 'loot-core/client/actions'; import { isPreviewId } from 'loot-core/shared/transactions'; import { type TransactionEntity } from 'loot-core/types/models'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { Menu } from '../common/Menu'; type BalanceMenuProps = Omit< @@ -36,7 +36,7 @@ export function TransactionMenu({ ...props }: BalanceMenuProps) { const { t } = useTranslation(); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const isPreview = isPreviewId(transaction.id); const linked = !!transaction.schedule; diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx index 743b0b509df..1b8a29e0177 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx @@ -59,7 +59,7 @@ import { SvgCalendar, SvgHyperlink2, } from '../../icons/v2'; -import { useAppDispatch } from '../../redux'; +import { useDispatch } from '../../redux'; import { styles, theme } from '../../style'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete'; @@ -568,7 +568,7 @@ function PayeeCell({ }) { const isCreatingPayee = useRef(false); - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const parentPayee = useParentPayee( payees, @@ -883,7 +883,7 @@ const Transaction = memo(function Transaction({ showSelection, allowSplitTransaction, }) { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const dispatchSelected = useSelectedDispatch(); const triggerRef = useRef(null); diff --git a/packages/desktop-client/src/components/util/GenericInput.jsx b/packages/desktop-client/src/components/util/GenericInput.jsx index bd20e99db85..3ed5d8ca7d9 100644 --- a/packages/desktop-client/src/components/util/GenericInput.jsx +++ b/packages/desktop-client/src/components/util/GenericInput.jsx @@ -6,7 +6,7 @@ import { integerToAmount, amountToInteger } from 'loot-core/src/shared/util'; import { useCategories } from '../../hooks/useCategories'; import { useDateFormat } from '../../hooks/useDateFormat'; -import { useAppSelector } from '../../redux'; +import { useSelector } from '../../redux'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; import { Autocomplete } from '../autocomplete/Autocomplete'; import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete'; @@ -36,7 +36,7 @@ export function GenericInput({ }) { const { grouped: categoryGroups } = useCategories(); const { data: savedReports } = useReports(); - const saved = useAppSelector(state => state.queries.saved); + const saved = useSelector(state => state.queries.saved); const dateFormat = useDateFormat() || 'MM/dd/yyyy'; const getNumberInputByFormatType = numberFormatType => { diff --git a/packages/desktop-client/src/hooks/useAccounts.ts b/packages/desktop-client/src/hooks/useAccounts.ts index 7bc9b13117f..06b279a0b10 100644 --- a/packages/desktop-client/src/hooks/useAccounts.ts +++ b/packages/desktop-client/src/hooks/useAccounts.ts @@ -2,11 +2,11 @@ import { useEffect } from 'react'; import { getAccounts } from 'loot-core/src/client/actions'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; export function useAccounts() { - const dispatch = useAppDispatch(); - const accountsLoaded = useAppSelector(state => state.queries.accountsLoaded); + const dispatch = useDispatch(); + const accountsLoaded = useSelector(state => state.queries.accountsLoaded); useEffect(() => { if (!accountsLoaded) { @@ -14,5 +14,5 @@ export function useAccounts() { } }, []); - return useAppSelector(state => state.queries.accounts); + return useSelector(state => state.queries.accounts); } diff --git a/packages/desktop-client/src/hooks/useActions.ts b/packages/desktop-client/src/hooks/useActions.ts index df25c0aefdf..f1ed715c7ee 100644 --- a/packages/desktop-client/src/hooks/useActions.ts +++ b/packages/desktop-client/src/hooks/useActions.ts @@ -6,7 +6,7 @@ import { type ThunkAction } from 'redux-thunk'; import * as actions from 'loot-core/src/client/actions'; import type { Action, State } from 'loot-core/src/client/state-types'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; type ActionReturnType unknown> = ReturnType extends ThunkAction @@ -26,7 +26,7 @@ export type BoundActions = { * @see https://github.com/reduxjs/react-redux/issues/1252#issuecomment-488160930 **/ export function useActions() { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); return useMemo(() => { return bindActionCreators(actions, dispatch); }, [dispatch]) as unknown as BoundActions; diff --git a/packages/desktop-client/src/hooks/useCategories.ts b/packages/desktop-client/src/hooks/useCategories.ts index 4af19885a55..6963c06f725 100644 --- a/packages/desktop-client/src/hooks/useCategories.ts +++ b/packages/desktop-client/src/hooks/useCategories.ts @@ -2,13 +2,11 @@ import { useEffect } from 'react'; import { getCategories } from 'loot-core/src/client/actions'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; export function useCategories() { - const dispatch = useAppDispatch(); - const categoriesLoaded = useAppSelector( - state => state.queries.categoriesLoaded, - ); + const dispatch = useDispatch(); + const categoriesLoaded = useSelector(state => state.queries.categoriesLoaded); useEffect(() => { if (!categoriesLoaded) { @@ -16,5 +14,5 @@ export function useCategories() { } }, []); - return useAppSelector(state => state.queries.categories); + return useSelector(state => state.queries.categories); } diff --git a/packages/desktop-client/src/hooks/useFailedAccounts.ts b/packages/desktop-client/src/hooks/useFailedAccounts.ts index 4497c006c51..86b20b948fc 100644 --- a/packages/desktop-client/src/hooks/useFailedAccounts.ts +++ b/packages/desktop-client/src/hooks/useFailedAccounts.ts @@ -1,9 +1,9 @@ import { useMemo } from 'react'; -import { useAppSelector } from '../redux'; +import { useSelector } from '../redux'; export function useFailedAccounts() { - const failedAccounts = useAppSelector(state => state.account.failedAccounts); + const failedAccounts = useSelector(state => state.account.failedAccounts); return useMemo( () => new Map(Object.entries(failedAccounts)), [failedAccounts], diff --git a/packages/desktop-client/src/hooks/useGlobalPref.ts b/packages/desktop-client/src/hooks/useGlobalPref.ts index a6c6fe2468f..22e2c1ef806 100644 --- a/packages/desktop-client/src/hooks/useGlobalPref.ts +++ b/packages/desktop-client/src/hooks/useGlobalPref.ts @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { saveGlobalPrefs } from 'loot-core/src/client/actions'; import { type GlobalPrefs } from 'loot-core/src/types/prefs'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; type SetGlobalPrefAction = ( value: GlobalPrefs[K], @@ -13,7 +13,7 @@ export function useGlobalPref( prefName: K, onSaveGlobalPrefs?: () => void, ): [GlobalPrefs[K], SetGlobalPrefAction] { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const setGlobalPref = useCallback>( value => { dispatch( @@ -27,7 +27,7 @@ export function useGlobalPref( }, [prefName, dispatch, onSaveGlobalPrefs], ); - const globalPref = useAppSelector( + const globalPref = useSelector( state => state.prefs.global?.[prefName] as GlobalPrefs[K], ); diff --git a/packages/desktop-client/src/hooks/useMetadataPref.ts b/packages/desktop-client/src/hooks/useMetadataPref.ts index f4e42222c99..7a16605996e 100644 --- a/packages/desktop-client/src/hooks/useMetadataPref.ts +++ b/packages/desktop-client/src/hooks/useMetadataPref.ts @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { savePrefs } from 'loot-core/client/actions'; import { type MetadataPrefs } from 'loot-core/types/prefs'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; type SetMetadataPrefAction = ( value: MetadataPrefs[K], @@ -12,14 +12,14 @@ type SetMetadataPrefAction = ( export function useMetadataPref( prefName: K, ): [MetadataPrefs[K], SetMetadataPrefAction] { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const setLocalPref = useCallback>( value => { dispatch(savePrefs({ [prefName]: value })); }, [prefName, dispatch], ); - const localPref = useAppSelector(state => state.prefs.local?.[prefName]); + const localPref = useSelector(state => state.prefs.local?.[prefName]); return [localPref, setLocalPref]; } diff --git a/packages/desktop-client/src/hooks/useModalState.ts b/packages/desktop-client/src/hooks/useModalState.ts index 94047d4f366..9b01288eea2 100644 --- a/packages/desktop-client/src/hooks/useModalState.ts +++ b/packages/desktop-client/src/hooks/useModalState.ts @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { popModal } from 'loot-core/client/actions'; import { type Modal } from 'loot-core/client/state-types/modals'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; type ModalState = { onClose: () => void; @@ -14,9 +14,9 @@ type ModalState = { }; export function useModalState(): ModalState { - const modalStack = useAppSelector(state => state.modals.modalStack); - const isHidden = useAppSelector(state => state.modals.isHidden); - const dispatch = useAppDispatch(); + const modalStack = useSelector(state => state.modals.modalStack); + const isHidden = useSelector(state => state.modals.isHidden); + const dispatch = useDispatch(); const popModalCallback = useCallback(() => { dispatch(popModal()); diff --git a/packages/desktop-client/src/hooks/usePayees.ts b/packages/desktop-client/src/hooks/usePayees.ts index 6c2fb62ff6e..91732a6d406 100644 --- a/packages/desktop-client/src/hooks/usePayees.ts +++ b/packages/desktop-client/src/hooks/usePayees.ts @@ -2,11 +2,11 @@ import { useEffect } from 'react'; import { getCommonPayees, getPayees } from 'loot-core/src/client/actions'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; export function useCommonPayees() { - const dispatch = useAppDispatch(); - const commonPayeesLoaded = useAppSelector( + const dispatch = useDispatch(); + const commonPayeesLoaded = useSelector( state => state.queries.commonPayeesLoaded, ); @@ -16,12 +16,12 @@ export function useCommonPayees() { } }, []); - return useAppSelector(state => state.queries.commonPayees); + return useSelector(state => state.queries.commonPayees); } export function usePayees() { - const dispatch = useAppDispatch(); - const payeesLoaded = useAppSelector(state => state.queries.payeesLoaded); + const dispatch = useDispatch(); + const payeesLoaded = useSelector(state => state.queries.payeesLoaded); useEffect(() => { if (!payeesLoaded) { @@ -29,5 +29,5 @@ export function usePayees() { } }, []); - return useAppSelector(state => state.queries.payees); + return useSelector(state => state.queries.payees); } diff --git a/packages/desktop-client/src/hooks/useSyncServerStatus.ts b/packages/desktop-client/src/hooks/useSyncServerStatus.ts index 8fe09e6a89d..0a28fe3b064 100644 --- a/packages/desktop-client/src/hooks/useSyncServerStatus.ts +++ b/packages/desktop-client/src/hooks/useSyncServerStatus.ts @@ -1,11 +1,11 @@ import { useServerURL } from '../components/ServerContext'; -import { useAppSelector } from '../redux'; +import { useSelector } from '../redux'; type SyncServerStatus = 'offline' | 'no-server' | 'online'; export function useSyncServerStatus(): SyncServerStatus { const serverUrl = useServerURL(); - const userData = useAppSelector(state => state.user.data); + const userData = useSelector(state => state.user.data); if (!serverUrl) { return 'no-server'; diff --git a/packages/desktop-client/src/hooks/useSyncedPref.ts b/packages/desktop-client/src/hooks/useSyncedPref.ts index c44fca5fa5c..310328a836a 100644 --- a/packages/desktop-client/src/hooks/useSyncedPref.ts +++ b/packages/desktop-client/src/hooks/useSyncedPref.ts @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { saveSyncedPrefs } from 'loot-core/client/actions'; import { type SyncedPrefs } from 'loot-core/src/types/prefs'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; type SetSyncedPrefAction = ( value: SyncedPrefs[K], @@ -12,14 +12,14 @@ type SetSyncedPrefAction = ( export function useSyncedPref( prefName: K, ): [SyncedPrefs[K], SetSyncedPrefAction] { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const setPref = useCallback>( value => { dispatch(saveSyncedPrefs({ [prefName]: value })); }, [prefName, dispatch], ); - const pref = useAppSelector(state => state.prefs.synced[prefName]); + const pref = useSelector(state => state.prefs.synced[prefName]); return [pref, setPref]; } diff --git a/packages/desktop-client/src/hooks/useSyncedPrefs.ts b/packages/desktop-client/src/hooks/useSyncedPrefs.ts index b52a36e9477..cdef01a4e9d 100644 --- a/packages/desktop-client/src/hooks/useSyncedPrefs.ts +++ b/packages/desktop-client/src/hooks/useSyncedPrefs.ts @@ -3,20 +3,20 @@ import { useCallback } from 'react'; import { saveSyncedPrefs } from 'loot-core/client/actions'; import { type SyncedPrefs } from 'loot-core/src/types/prefs'; -import { useAppSelector, useAppDispatch } from '../redux'; +import { useSelector, useDispatch } from '../redux'; type SetSyncedPrefsAction = (value: Partial) => void; /** @deprecated: please use `useSyncedPref` (singular) */ export function useSyncedPrefs(): [SyncedPrefs, SetSyncedPrefsAction] { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const setPrefs = useCallback( newValue => { dispatch(saveSyncedPrefs(newValue)); }, [dispatch], ); - const prefs = useAppSelector(state => state.prefs.synced); + const prefs = useSelector(state => state.prefs.synced); return [prefs, setPrefs]; } diff --git a/packages/desktop-client/src/hooks/useTransactionBatchActions.ts b/packages/desktop-client/src/hooks/useTransactionBatchActions.ts index 1d0ef59b3a6..ff612ac4c83 100644 --- a/packages/desktop-client/src/hooks/useTransactionBatchActions.ts +++ b/packages/desktop-client/src/hooks/useTransactionBatchActions.ts @@ -17,7 +17,7 @@ import { type TransactionEntity, } from 'loot-core/types/models'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; type BatchEditProps = { name: keyof TransactionEntity; @@ -55,7 +55,7 @@ type BatchUnlinkScheduleProps = { }; export function useTransactionBatchActions() { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const onBatchEdit = async ({ name, ids, onSuccess }: BatchEditProps) => { const { data } = await runQuery( diff --git a/packages/desktop-client/src/hooks/useUndo.ts b/packages/desktop-client/src/hooks/useUndo.ts index f13eed64df4..64924d5b66f 100644 --- a/packages/desktop-client/src/hooks/useUndo.ts +++ b/packages/desktop-client/src/hooks/useUndo.ts @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { undo, redo, addNotification } from 'loot-core/client/actions'; import { type Notification } from 'loot-core/client/state-types/notifications'; -import { useAppDispatch } from '../redux'; +import { useDispatch } from '../redux'; type UndoActions = { undo: () => void; @@ -15,7 +15,7 @@ type UndoActions = { const timeout = 10000; export function useUndo(): UndoActions { - const dispatch = useAppDispatch(); + const dispatch = useDispatch(); const dispatchUndo = useCallback(() => { dispatch(undo()); diff --git a/packages/desktop-client/src/hooks/useUpdatedAccounts.ts b/packages/desktop-client/src/hooks/useUpdatedAccounts.ts index de083ceb64d..25a7ec729d1 100644 --- a/packages/desktop-client/src/hooks/useUpdatedAccounts.ts +++ b/packages/desktop-client/src/hooks/useUpdatedAccounts.ts @@ -1,5 +1,5 @@ -import { useAppSelector } from '../redux'; +import { useSelector } from '../redux'; export function useUpdatedAccounts() { - return useAppSelector(state => state.queries.updatedAccounts); + return useSelector(state => state.queries.updatedAccounts); } diff --git a/packages/desktop-client/src/redux/index.ts b/packages/desktop-client/src/redux/index.ts index 383f3369974..5cb89bbd39b 100644 --- a/packages/desktop-client/src/redux/index.ts +++ b/packages/desktop-client/src/redux/index.ts @@ -1,6 +1,9 @@ -import { useDispatch, useSelector } from 'react-redux'; +import { + useDispatch as useReduxDispatch, + useSelector as useReduxSelector, +} from 'react-redux'; import { type AppDispatch, type RootState } from 'loot-core/client/store'; -export const useAppDispatch = useDispatch.withTypes(); -export const useAppSelector = useSelector.withTypes(); +export const useDispatch = useReduxDispatch.withTypes(); +export const useSelector = useReduxSelector.withTypes();