Skip to content
Snippets Groups Projects
Unverified Commit 77a670bb authored by Joel Jeremy Marquez's avatar Joel Jeremy Marquez Committed by GitHub
Browse files

[Mobile] Scheduled transaction menu modal (#2608)

* Mobile scheduled transaction menu modal

* Release notes
parent 1a1fe9ac
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import memoizeOne from 'memoize-one'; ...@@ -11,6 +11,7 @@ import memoizeOne from 'memoize-one';
import { useDebounceCallback } from 'usehooks-ts'; import { useDebounceCallback } from 'usehooks-ts';
import { import {
collapseModals,
getPayees, getPayees,
markAccountRead, markAccountRead,
openAccountCloseModal, openAccountCloseModal,
...@@ -182,6 +183,10 @@ function TransactionListWithPreviews({ account }) { ...@@ -182,6 +183,10 @@ function TransactionListWithPreviews({ account }) {
updateQuery(query); updateQuery(query);
}, [makeRootQuery, updateQuery]); }, [makeRootQuery, updateQuery]);
const refetchTransactions = () => {
paged.current?.run();
};
useEffect(() => { useEffect(() => {
const unlisten = listen('sync-event', ({ type, tables }) => { const unlisten = listen('sync-event', ({ type, tables }) => {
if (type === 'applied') { if (type === 'applied') {
...@@ -190,7 +195,7 @@ function TransactionListWithPreviews({ account }) { ...@@ -190,7 +195,7 @@ function TransactionListWithPreviews({ account }) {
tables.includes('category_mapping') || tables.includes('category_mapping') ||
tables.includes('payee_mapping') tables.includes('payee_mapping')
) { ) {
paged.current?.run(); refetchTransactions();
} }
if (tables.includes('payees') || tables.includes('payee_mapping')) { if (tables.includes('payees') || tables.includes('payee_mapping')) {
...@@ -231,9 +236,24 @@ function TransactionListWithPreviews({ account }) { ...@@ -231,9 +236,24 @@ function TransactionListWithPreviews({ account }) {
}; };
const onSelectTransaction = transaction => { 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)) { if (!isPreviewId(transaction.id)) {
navigate(`/transactions/${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'));
},
}),
);
} }
}; };
......
---
category: Enhancements
authors: [joel-jeremy]
---
Allow posting/skipping scheduled transactions in mobile view.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment