fix(tabs): allow saving a saved sql tab after clearing content

Closes #9247
This commit is contained in:
t8y2 authored and GitHub committed 2026-09-16 23:24:10 +08:00
1 parent 57e98b6d86
commit b891bf80fd
4 files changed
+66 -5

No files matched your search

+1 -4
View File
@@ -105,6 +105,7 @@ import {
tabSwitcherDirectionFromShortcut,
} from "@/lib/editor/keyboardShortcuts";
import { createTabNavigationHistory, moveInTabNavigationHistory, recordTabVisit } from "@/lib/tabs/tabNavigationHistory";
import { canSaveSqlTab } from "@/lib/tabs/sqlTabSaveTarget";
import { initialTabSwitcherSelection, moveTabSwitcherSelection, tabSwitcherOrder } from "@/lib/tabs/tabSwitcher";
import { createTabSwitcherKeyboardController } from "@/lib/tabs/tabSwitcherKeyboard";
import { formatShortcutDisplay } from "@/lib/editor/shortcutDisplay";
@@ -1669,10 +1670,6 @@ function finishSqlLibraryFlyAnimation(animationId: number) {
sqlLibrarySaveFeedbackId.value += 1;
}
function canSaveSqlTab(tab: QueryTab): boolean {
return !!tab.externalSqlPath || !!tab.sql.trim();
}
function closePendingSavedTab() {
if (!pendingSaveAndCloseTabId.value) return;
const closeId = pendingSaveAndCloseTabId.value;