Skip to content

A local-first personal finance app

[Mobile] Scheduled transaction menu modal (#2608)

Joel Jeremy Marquez77a670bbc3ab
diff --git a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.jsx b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.jsx
index cf9c1c2e27..01fc53bb4e 100644
--- a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.jsx
+++ b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.jsx
@@ -11,6 +11,7 @@ import memoizeOne from 'memoize-one';
import { useDebounceCallback } from 'usehooks-ts';
import {
+ collapseModals,
getPayees,
markAccountRead,
openAccountCloseModal,
@@ -182,6 +183,10 @@ function TransactionListWithPreviews({ account }) {
updateQuery(query);
}, [makeRootQuery, updateQuery]);
+ const refetchTransactions = () => {
+ paged.current?.run();
+ };
+
useEffect(() => {
const unlisten = listen('sync-event', ({ type, tables }) => {
if (type === 'applied') {
@@ -190,7 +195,7 @@ function TransactionListWithPreviews({ account }) {
tables.includes('category_mapping') ||
tables.includes('payee_mapping')
) {
- paged.current?.run();
+ refetchTransactions();
}
if (tables.includes('payees') || tables.includes('payee_mapping')) {
@@ -231,9 +236,24 @@ function TransactionListWithPreviews({ account }) {
};
const onSelectTransaction = transaction => {
- // details of how the native app used to handle preview transactions here can be found at commit 05e58279
if (!isPreviewId(transaction.id)) {
navigate(`/transactions/${transaction.id}`);
+ } else {
+ dispatch(
+ pushModal('scheduled-transaction-menu', {
+ transactionId: transaction.id,
+ onPost: async transactionId => {
+ const parts = transactionId.split('/');
+ await send('schedule/post-transaction', { id: parts[1] });
+ dispatch(collapseModals('scheduled-transaction-menu'));
+ },
+ onSkip: async transactionId => {
+ const parts = transactionId.split('/');
+ await send('schedule/skip-next-date', { id: parts[1] });
+ dispatch(collapseModals('scheduled-transaction-menu'));
+ },
+ }),
+ );
}
};
diff --git a/upcoming-release-notes/2608.md b/upcoming-release-notes/2608.md
new file mode 100644
index 0000000000..48a2e1b548
--- /dev/null
+++ b/upcoming-release-notes/2608.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [joel-jeremy]
+---
+
+Allow posting/skipping scheduled transactions in mobile view.