From 8a4a9ba08305f3ccd074df6870bada78530c6a38 Mon Sep 17 00:00:00 2001 From: Matt Fiddaman <github@m.fiddaman.uk> Date: Tue, 3 Sep 2024 21:25:46 +0100 Subject: [PATCH] fix incorrect hook usage in #3277 (#3356) * fix incorrect hook usage in #3277 * release note --- .../desktop-client/src/components/accounts/Account.tsx | 10 +--------- upcoming-release-notes/3356.md | 6 ++++++ 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 upcoming-release-notes/3356.md diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx index 9c5c93877..07090da96 100644 --- a/packages/desktop-client/src/components/accounts/Account.tsx +++ b/packages/desktop-client/src/components/accounts/Account.tsx @@ -6,7 +6,7 @@ import React, { useMemo, type ReactElement, } from 'react'; -import { Trans, useTranslation } from 'react-i18next'; +import { Trans } from 'react-i18next'; import { useSelector } from 'react-redux'; import { Navigate, useParams, useLocation } from 'react-router-dom'; @@ -597,8 +597,6 @@ class AccountInternal extends PureComponent< }; onImport = async () => { - const { t } = useTranslation(); - const accountId = this.props.accountId; const account = this.props.accounts.find(acct => acct.id === accountId); const categories = await this.props.getCategories(); @@ -629,8 +627,6 @@ class AccountInternal extends PureComponent< }; onExport = async (accountName: string) => { - const { t } = useTranslation(); - const exportedTransactions = await send('transactions-export-query', { query: this.currentQuery.serialize(), }); @@ -951,8 +947,6 @@ class AccountInternal extends PureComponent< }; onCreateReconciliationTransaction = async (diff: number) => { - const { t } = useTranslation(); - // Create a new reconciliation transaction const reconciliationTransactions = realizeTempTransactions([ { @@ -979,8 +973,6 @@ class AccountInternal extends PureComponent< }; onShowTransactions = async (ids: string[]) => { - const { t } = useTranslation(); - this.onApplyFilter({ customName: t('Selected transactions'), queryFilter: { id: { $oneof: ids } }, diff --git a/upcoming-release-notes/3356.md b/upcoming-release-notes/3356.md new file mode 100644 index 000000000..f8accb98a --- /dev/null +++ b/upcoming-release-notes/3356.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [matt-fidd] +--- + +Fix incorrect hook usage in #3277 -- GitLab