MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getTabModelByTabId

Function getTabModelByTabId

frontend/app/store/tab-model.ts:54–70  ·  view source on GitHub ↗
(tabId: string, waveEnv?: TabModelEnv)

Source from the content-addressed store, hash-verified

52}
53
54export function getTabModelByTabId(tabId: string, waveEnv?: TabModelEnv): TabModel {
55 if (!waveEnv?.isMock) {
56 let model = tabModelCache.get(tabId);
57 if (model == null) {
58 model = new TabModel(tabId, waveEnv);
59 tabModelCache.set(tabId, model);
60 }
61 return model;
62 }
63 const key = `TabModel:${tabId}`;
64 let model = waveEnv.mockModels.get(key);
65 if (model == null) {
66 model = new TabModel(tabId, waveEnv);
67 waveEnv.mockModels.set(key, model);
68 }
69 return model;
70}
71
72export function getActiveTabModel(waveEnv?: TabModelEnv): TabModel | null {
73 const activeTabId = globalStore.get(activeTabIdAtom);

Callers 5

AppFunction · 0.90
tab.tsxFile · 0.90
VTabWrapperFunction · 0.90
PreviewRootFunction · 0.90
getActiveTabModelFunction · 0.85

Calls 2

getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected