diff --git a/packages/desktop-client/src/components/FinancesApp.js b/packages/desktop-client/src/components/FinancesApp.js index 8d6c3bc5cc1d9245e95c2208f9122ad2f0361746..c977e3c430b29d9ac6c9e59b6dac2bf605526d48 100644 --- a/packages/desktop-client/src/components/FinancesApp.js +++ b/packages/desktop-client/src/components/FinancesApp.js @@ -9,7 +9,6 @@ import { NavLink, useNavigate, BrowserRouter, - useParams, } from 'react-router-dom'; import hotkeys from 'hotkeys-js'; @@ -144,7 +143,7 @@ function StackedRoutesInner({ location }) { <Route path="/accounts/:id" - element={<AccountCmp isNarrowWidth={isNarrowWidth} />} + element={isNarrowWidth ? <MobileAccount /> : <Account />} /> <Route @@ -155,14 +154,6 @@ function StackedRoutesInner({ location }) { ); } -// Needed to re-mount the component for each account ID change -function AccountCmp(props) { - const { id } = useParams(); - const Component = props.isNarrowWidth ? MobileAccount : Account; - - return <Component key={id} {...props} />; -} - function NavTab({ icon: TabIcon, name, path }) { return ( <NavLink diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index 1dcd56c381648e67c99eb2109bfcc32b578a219a..296af367f16ab26d0c4fdc5c172899829dda7914 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -1290,7 +1290,7 @@ class AccountInternal extends PureComponent { } componentWillReceiveProps(nextProps) { - if (this.props.match !== nextProps.match) { + if (this.props.accountId !== nextProps.accountId) { this.setState( { editingName: false, diff --git a/packages/desktop-client/src/components/budget/index.js b/packages/desktop-client/src/components/budget/index.js index a706a9069772d0872711cdd3d4a67258c81154a3..b14ab026787f37977fc892f027939fa77bdd45c6 100644 --- a/packages/desktop-client/src/components/budget/index.js +++ b/packages/desktop-client/src/components/budget/index.js @@ -111,7 +111,7 @@ class Budget extends PureComponent { _initialBudgetMonth = this.state.startMonth; } - if (this.props.match && !prevProps.match) { + if (this.props.accountId !== prevProps.accountId) { // Make to sure to check if the budget bounds have changed, and // if so reload the budget data send('get-budget-bounds').then(({ start, end }) => { diff --git a/upcoming-release-notes/1171.md b/upcoming-release-notes/1171.md new file mode 100644 index 0000000000000000000000000000000000000000..518894fb99db21b35c93b56ddd28b0f467d48c00 --- /dev/null +++ b/upcoming-release-notes/1171.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [j-f1] +--- + +Fix transaction list page being blank on mobile