From 01b6460336ef58271bc2471e340221a4a64cb7c1 Mon Sep 17 00:00:00 2001 From: emily Date: Sat, 28 Feb 2026 16:21:59 -0500 Subject: [PATCH] fix(views): call navigation callbacks before async ops to prevent unmounting Made-with: Cursor --- views/ProductView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/ProductView.tsx b/views/ProductView.tsx index f313381..37be047 100644 --- a/views/ProductView.tsx +++ b/views/ProductView.tsx @@ -77,6 +77,8 @@ const ProductView = ({ } const handleIDontNeedIt = async () => { + onShowIDontNeedIt(product) + if (product) { try { await ProductActionManager.dontNeedIt(product) @@ -84,10 +86,11 @@ const ProductView = ({ console.error("[ProductView] Failed to execute dontNeedIt:", error) } } - onShowIDontNeedIt(product) } const handleINeedIt = async () => { + onShowINeedIt() + if (product) { try { await ProductActionManager.needIt(product) @@ -95,7 +98,6 @@ const ProductView = ({ console.error("[ProductView] Failed to execute needIt:", error) } } - onShowINeedIt() } const handleCloseClick = () => {