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 when pressing Enter adds an extra split transaction when no split remains #2144

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

jasonmichalski
Copy link
Contributor

Fixes #2041

A race condition existed where the parent transaction in transactionMap was not yet updated to reflect the recently added child transaction when onCheckEnter() 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.

Copy link

netlify bot commented Dec 30, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 38a22b1
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6592d7f25ce74d0008769d2f
😎 Deploy Preview https://deploy-preview-2144.demo.actualbudget.org/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Dec 30, 2023

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
15 3.09 MB → 3.09 MB (+11 B) +0.00%
Changeset
File Δ Size
src/components/transactions/TransactionsTable.jsx 📈 +13 B (+0.02%) 67.59 kB → 67.61 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/wide-components.chunk.js 113.08 kB → 113.09 kB (+11 B) +0.01%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/main.js 1.43 MB 0%
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/231.chunk.js 117.38 kB 0%
static/js/reports.chunk.js 78.28 kB 0%
static/js/narrow-components.chunk.js 45.2 kB 0%
static/js/553.chunk.js 28.56 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 1.92 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 911 B 0%

Copy link
Contributor

github-actions bot commented Dec 30, 2023

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
2 2.23 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.24 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

youngcw
youngcw previously approved these changes Dec 31, 2023
Comment on lines 1970 to 1973
const parentIdx = transactions.findIndex(
t => t.id === transactions[idx]?.parent_id,
);
const parent = transactions[parentIdx];
Copy link
Contributor

@kymckay kymckay Jan 1, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call - fixed!

@joel-jeremy joel-jeremy merged commit d203def into actualbudget:master Jan 6, 2024
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Jan 6, 2024
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
… remains (actualbudget#2144)

* Fix pressing enter adds split transaction when no split remains

* Added release notes

* Refactor to use find indstead of findIndex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Pressing Enter when adding the final split transaction entry adds another child transaction
4 participants