[Bug]: Mobile accounts view is broken on master #550

Closed
opened 2026-02-28 19:08:44 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Cldfire on GitHub (Aug 7, 2023).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

https://github.com/actualbudget/actual/pull/1382 appears to have broken the mobile accounts view.

Loading the mobile accounts view repeatedly triggers this error:

Screenshot 2023-08-07 at 5 33 40 PM

That error is happening in this code:

c2d5d475b9/packages/desktop-client/src/components/transactions/MobileTransaction.js (L53-L55)

Which gets called when rendering transactions in the mobile account view:

c2d5d475b9/packages/desktop-client/src/components/transactions/MobileTransaction.js (L132)

c2d5d475b9/packages/desktop-client/src/components/transactions/MobileTransaction.js (L333-L341)

It turns out this is happening because categories in transaction props is undefined.

What error did you receive?

No response

Where are you hosting Actual?

Locally via Yarn

What browsers are you seeing the problem on?

Safari

Operating System

Mac OSX

Originally created by @Cldfire on GitHub (Aug 7, 2023). ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? https://github.com/actualbudget/actual/pull/1382 appears to have broken the mobile accounts view. Loading the mobile accounts view repeatedly triggers this error: <img width="776" alt="Screenshot 2023-08-07 at 5 33 40 PM" src="https://github.com/actualbudget/actual/assets/13814214/33302f47-fb06-4360-837b-322d1ef24132"> That error is happening in this code: https://github.com/actualbudget/actual/blob/c2d5d475b9202a994e79a723b3a9ede3949af327/packages/desktop-client/src/components/transactions/MobileTransaction.js#L53-L55 Which gets called when rendering transactions in the mobile account view: https://github.com/actualbudget/actual/blob/c2d5d475b9202a994e79a723b3a9ede3949af327/packages/desktop-client/src/components/transactions/MobileTransaction.js#L132 https://github.com/actualbudget/actual/blob/c2d5d475b9202a994e79a723b3a9ede3949af327/packages/desktop-client/src/components/transactions/MobileTransaction.js#L333-L341 It turns out this is happening because `categories` in transaction props is `undefined`. ### What error did you receive? _No response_ ### Where are you hosting Actual? Locally via Yarn ### What browsers are you seeing the problem on? Safari ### Operating System Mac OSX
GiteaMirror added the bug label 2026-02-28 19:08:44 -06:00
Author
Owner

@Cldfire commented on GitHub (Aug 7, 2023):

c2d5d475b9/packages/desktop-client/src/components/accounts/MobileAccount.js (L248-L273)

The categories prop is being set to state.categories, but because of the changes in #1382 state no longer contains categories:

c2d5d475b9/packages/desktop-client/src/components/accounts/MobileAccount.js (L82-L87)

Which is causing the bug.

@Cldfire commented on GitHub (Aug 7, 2023): https://github.com/actualbudget/actual/blob/c2d5d475b9202a994e79a723b3a9ede3949af327/packages/desktop-client/src/components/accounts/MobileAccount.js#L248-L273 The `categories` prop is being set to `state.categories`, but because of the changes in #1382 `state` no longer contains `categories`: https://github.com/actualbudget/actual/blob/c2d5d475b9202a994e79a723b3a9ede3949af327/packages/desktop-client/src/components/accounts/MobileAccount.js#L82-L87 Which is causing the bug.
Author
Owner

@kyrias commented on GitHub (Aug 7, 2023):

Ah, indeed. I think this diff should fix it?

diff --git a/packages/desktop-client/src/components/accounts/MobileAccount.js b/packages/desktop-client/src/components/accounts/MobileAccount.js
index ebf5c73f..e74c81f9 100644
--- a/packages/desktop-client/src/components/accounts/MobileAccount.js
+++ b/packages/desktop-client/src/components/accounts/MobileAccount.js
@@ -150,7 +150,7 @@ export default function Account(props) {
   }, []);
 
   // Load categories if necessary.
-  useCategories();
+  const { list: categories } = useCategories();
 
   const updateSearchQuery = debounce(() => {
     if (searchText === '' && currentQuery) {
@@ -253,7 +253,7 @@ export default function Account(props) {
                   key={numberFormat + hideFraction}
                   account={account}
                   accounts={accounts}
-                  categories={state.categories}
+                  categories={categories}
                   payees={state.payees}
                   transactions={transactions}
                   prependTransactions={prependTransactions || []}
@kyrias commented on GitHub (Aug 7, 2023): Ah, indeed. I think this diff should fix it? ```diff diff --git a/packages/desktop-client/src/components/accounts/MobileAccount.js b/packages/desktop-client/src/components/accounts/MobileAccount.js index ebf5c73f..e74c81f9 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccount.js +++ b/packages/desktop-client/src/components/accounts/MobileAccount.js @@ -150,7 +150,7 @@ export default function Account(props) { }, []); // Load categories if necessary. - useCategories(); + const { list: categories } = useCategories(); const updateSearchQuery = debounce(() => { if (searchText === '' && currentQuery) { @@ -253,7 +253,7 @@ export default function Account(props) { key={numberFormat + hideFraction} account={account} accounts={accounts} - categories={state.categories} + categories={categories} payees={state.payees} transactions={transactions} prependTransactions={prependTransactions || []} ```
Author
Owner

@Cldfire commented on GitHub (Aug 7, 2023):

Yeah, I'm opening a PR :)

@Cldfire commented on GitHub (Aug 7, 2023): Yeah, I'm opening a PR :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#550