Skip to content

fix(views): call navigation callbacks before async ops to prevent unmounting#31

Merged
emypeeler merged 1 commit intomasterfrom
product_view_unmounting
Feb 28, 2026
Merged

fix(views): call navigation callbacks before async ops to prevent unmounting#31
emypeeler merged 1 commit intomasterfrom
product_view_unmounting

Conversation

@emypeeler
Copy link
Copy Markdown
Contributor

Summary

Call onShowIDontNeedIt and onShowINeedIt before the async storage operations instead of after. This ensures the UI transitions immediately when the user clicks, avoiding component unmounting during async work.

Changes

  • views/ProductView.tsx: Move onShowIDontNeedIt(product) and onShowINeedIt() to the start of handleIDontNeedIt and handleINeedIt respectively, before ProductActionManager.dontNeedIt/needIt calls.

Breaking changes

None.

Testing

  • Manual: Click "I don't need it" / "I need it" — celebration view should appear immediately.
  • E2E: npm run test:e2e (idontneedit, ineedit flows).

Made with Cursor

@emypeeler emypeeler added bug Something isn't working area:content labels Feb 28, 2026
@emypeeler emypeeler merged commit b54adda into master Feb 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:content bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants