Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c062c7e

Browse files
committed
refactor(play.loradb.com): consolidate workspace active-tab resolution
1 parent d0bdf25 commit c062c7e

4 files changed

Lines changed: 1442 additions & 13 deletions

File tree

apps/play.loradb.com/lib/actions/runActiveTab.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { useStore } from "@/lib/state/store";
1414
import { run } from "@/lib/db/client";
1515
import { ulid } from "@/lib/util/id";
1616
import { appendHistoryEntry } from "@/lib/actions/historyActions";
17+
import { getActiveTabId } from "@/lib/actions/workspaceActions";
1718

1819
/**
1920
* Heuristic — any query that touches one of these keywords is assumed
@@ -28,7 +29,8 @@ export const LORADB_MUTATION_EVENT = "loradb:mutation";
2829

2930
export async function runActiveTab(): Promise<string | null> {
3031
const state = useStore.getState();
31-
const tabId = state.activeTabId;
32+
// Derived from the workspace tree — see resolveActiveTabId in tree.ts.
33+
const tabId = getActiveTabId();
3234
if (tabId === null) return null;
3335
const tab = state.tabs.find((t) => t.id === tabId);
3436
if (!tab) return null;

0 commit comments

Comments
 (0)