fix: clear stale dialog actions when target pane is inactive
When a dialog action's targetSide matched but the pane was inactive, the action was left in the store. If the pane later became active, it would fire the stale action unexpectedly. Now inactive panes clear the action to prevent this. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,7 +93,12 @@ export const useSftpDialogActionHandler = (
|
||||
const action = useSftpDialogAction();
|
||||
|
||||
useEffect(() => {
|
||||
if (!action || action.targetSide !== side || !isActive) return;
|
||||
if (!action || action.targetSide !== side) return;
|
||||
if (!isActive) {
|
||||
// Clear stale action so it doesn't fire when this pane becomes active later
|
||||
sftpDialogActionStore.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle the action and clear it
|
||||
switch (action.type) {
|
||||
|
||||
Reference in New Issue
Block a user