From 5dc2fe93415bbb89c92082bc9b5b6f379bc8d44c Mon Sep 17 00:00:00 2001 From: Test Date: Thu, 9 Apr 2026 12:38:39 +0200 Subject: [PATCH] fix: narrow pending tab swap target path --- src/hooks/useEditorTabSwap.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/useEditorTabSwap.ts b/src/hooks/useEditorTabSwap.ts index 84b77761..b107604a 100644 --- a/src/hooks/useEditorTabSwap.ts +++ b/src/hooks/useEditorTabSwap.ts @@ -395,12 +395,15 @@ function useTabSwapEffect(options: { if (!rememberPendingTabArrival(activeTabPath, activeTab, pendingTabArrivalPathRef)) { return } + const targetPath = activeTabPath + const readyActiveTab = activeTab + if (!targetPath || !readyActiveTab) return scheduleTabSwap({ editor, cache, - targetPath: activeTabPath, - activeTab: activeTab!, + targetPath, + activeTab: readyActiveTab, pendingSwapRef, prevActivePathRef, rawSwapPendingRef,