Close rewind menu when the action errors
handleSelect only ran setIsOpen(false) on the success path. When the rewind action failed, the catch block swallowed the error but the menu stayed open, blocking subsequent interactions with the page. Close in finally so success and error both dismiss the menu.
This commit is contained in:
@@ -61,11 +61,11 @@ export const RewindMenu = memo(function RewindMenu({
|
||||
setPendingMode(mode);
|
||||
try {
|
||||
await onRewind({ mode, rewoundText });
|
||||
setIsOpen(false);
|
||||
} catch {
|
||||
// useRewindAgentMutation owns the toast; the menu only owns flow state.
|
||||
} finally {
|
||||
setPendingMode(null);
|
||||
setIsOpen(false);
|
||||
}
|
||||
},
|
||||
[isLocked, onRewind, rewoundText],
|
||||
|
||||
Reference in New Issue
Block a user