-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 when pressing Enter adds an extra split transaction when no split remains #2144
Fix when pressing Enter adds an extra split transaction when no split remains #2144
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
const parentIdx = transactions.findIndex( | ||
t => t.id === transactions[idx]?.parent_id, | ||
); | ||
const parent = transactions[parentIdx]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you could use .find
directly if the index isn't used anywhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call - fixed!
… remains (actualbudget#2144) * Fix pressing enter adds split transaction when no split remains * Added release notes * Refactor to use find indstead of findIndex
Fixes #2041
A race condition existed where the parent transaction in
transactionMap
was not yet updated to reflect the recently added child transaction whenonCheckEnter()
is called.This PR gets the parent transaction from the same transactions array that the child transaction is retrieved from, which reflects the latest split calculation / error state.