Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix flicker when saving transaction on account page when transactions are scheduled #3920

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ export function useAccountPreviewTransactions({
const payees = usePayees();

const previewTransactions = useMemo(() => {
if (isLoading) {
return [];
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing the flicker - we reset the preview transactions array whenever we saved a transaction on the page. I think this is unnecessary.


if (!accountId) {
return originalPreviewTransactions;
}
Expand All @@ -50,9 +46,12 @@ export function useAccountPreviewTransactions({
a => a.id === payees.find(p => p.id === payeeId)?.transfer_acct,
),
});
}, [accountId, accounts, isLoading, originalPreviewTransactions, payees]);
}, [accountId, accounts, originalPreviewTransactions, payees]);

return { isLoading, previewTransactions };
return {
isLoading,
previewTransactions,
};
}

type AccountPreviewProps = {
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3920.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MikesGlitch]
---

Fix flickering when saving a transaction when there are transactions scheduled