From 32ecd52f2b7ab8df649198d504525ea3af43cd82 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins <matiss@mja.lv> Date: Sun, 2 Jul 2023 15:51:18 +0100 Subject: [PATCH] :bug: fix toggling of balances in all-accounts view (#1252) Closes #1249 Also removing some unused code --- .../src/components/accounts/Account.js | 39 +------------------ upcoming-release-notes/1252.md | 6 +++ 2 files changed, 8 insertions(+), 37 deletions(-) create mode 100644 upcoming-release-notes/1252.md diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index b61099ee2..998825bf6 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -484,42 +484,7 @@ function Balances({ ); } -// function ScheduleMenu({ onSelect, onClose }) { -// let params = useParams(); -// let scheduleData = useCachedSchedules(); -// let payees = useSelector(state => state.queries.payees); -// let byId = getPayeesById(payees); - -// if (scheduleData == null) { -// return null; -// } - -// return ( -// <Tooltip -// position="bottom-right" -// width={200} -// style={{ padding: 0 }} -// onClose={onClose} -// > -// <Menu -// onMenuSelect={name => { -// onSelect(name); -// onClose(); -// }} -// items={scheduleData.schedules.map(s => { -// let desc = s._payee -// ? `${byId[s._payee].name} (${s.next_date})` -// : `No payee (${s.next_date})`; - -// return { name: s.id, text: desc }; -// })} -// /> -// </Tooltip> -// ); -// } - function SelectedTransactionsButton({ - style, getTransaction, onShow, onDuplicate, @@ -1455,7 +1420,7 @@ class AccountInternal extends PureComponent { onToggleExtraBalances = () => { let { accountId, showExtraBalances } = this.props; - let key = 'show-extra-balances-' + accountId; + let key = 'show-extra-balances-' + accountId || 'all-accounts'; this.props.savePrefs({ [key]: !showExtraBalances }); }; @@ -2110,7 +2075,7 @@ export default function Account() { showBalances: params.id && state.prefs.local['show-balances-' + params.id], showCleared: params.id && !state.prefs.local['hide-cleared-' + params.id], showExtraBalances: - params.id && state.prefs.local['show-extra-balances-' + params.id], + state.prefs.local['show-extra-balances-' + params.id || 'all-accounts'], payees: state.queries.payees, modalShowing: state.modals.modalStack.length > 0, accountsSyncing: state.account.accountsSyncing, diff --git a/upcoming-release-notes/1252.md b/upcoming-release-notes/1252.md new file mode 100644 index 000000000..9455dc7ef --- /dev/null +++ b/upcoming-release-notes/1252.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Fix toggling of balances in all-accounts view -- GitLab