MCPcopy
hub / github.com/wavetermdev/waveterm / constructor

Method constructor

emain/emain-tabview.ts:136–173  ·  view source on GitHub ↗
(fullConfig: FullConfigType)

Source from the content-addressed store, hash-verified

134 resetChordModeTimeout: NodeJS.Timeout = null;
135
136 constructor(fullConfig: FullConfigType) {
137 console.log("createBareTabView");
138 super({
139 webPreferences: {
140 preload: path.join(getElectronAppBasePath(), "preload", "index.cjs"),
141 webviewTag: true,
142 },
143 });
144 this.createdTs = Date.now();
145 this.isWaveAIOpen = false;
146 this.savedInitOpts = null;
147 this.initPromise = new Promise((resolve, _) => {
148 this.initResolve = resolve;
149 });
150 this.initPromise.then(() => {
151 this.isInitialized = true;
152 console.log("tabview init", Date.now() - this.createdTs + "ms");
153 });
154 this.waveReadyPromise = new Promise((resolve, _) => {
155 this.waveReadyResolve = resolve;
156 });
157 this.waveReadyPromise.then(() => {
158 this.isWaveReady = true;
159 });
160 const wcId = this.webContents.id;
161 wcIdToWaveTabMap.set(wcId, this);
162 if (isDevVite) {
163 this.webContents.loadURL(`${process.env.ELECTRON_RENDERER_URL}/index.html`);
164 } else {
165 this.webContents.loadFile(path.join(getElectronAppBasePath(), "frontend", "index.html"));
166 }
167 this.webContents.on("destroyed", () => {
168 wcIdToWaveTabMap.delete(wcId);
169 removeWaveTabView(this.waveTabId);
170 this.isDestroyed = true;
171 });
172 this.setBackgroundColor(computeBgColor(fullConfig));
173 }
174
175 get waveTabId(): string {
176 return this._waveTabId;

Callers

nothing calls this directly

Calls 7

getElectronAppBasePathFunction · 0.90
removeWaveTabViewFunction · 0.85
computeBgColorFunction · 0.85
setMethod · 0.80
loadFileMethod · 0.80
onMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected