Skip to content

Commit fd52e06

Browse files
authored
Reduce calls to Git (Setup webview) (#4441)
1 parent c664350 commit fd52e06

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

extension/src/setup/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ export class Setup
156156

157157
this.webviewMessages = this.createWebviewMessageHandler()
158158

159-
if (this.webview) {
160-
void this.sendDataToWebview()
161-
}
159+
void this.sendDataToWebview()
162160

163161
this.getHasData = () => experiments.getHasData()
164162
this.getExpShowError = () => experiments.getCliError()
@@ -213,9 +211,7 @@ export class Setup
213211

214212
public async showSetup(focusSection?: SetupSection) {
215213
this.focusedSection = focusSection
216-
if (this.webview) {
217-
void this.sendDataToWebview()
218-
}
214+
void this.sendDataToWebview()
219215

220216
return await this.showWebview()
221217
}
@@ -258,7 +254,7 @@ export class Setup
258254
}
259255

260256
public isFocused() {
261-
return !!this.webview?.isActive
257+
return !!this.getWebview()?.isActive
262258
}
263259

264260
public shouldBeShown(): { dvc: boolean; experiments: boolean } {
@@ -401,6 +397,10 @@ export class Setup
401397
}
402398

403399
private async sendDataToWebview() {
400+
if (!this.getWebview()) {
401+
return
402+
}
403+
404404
const projectInitialized = this.hasRoots()
405405
const hasData = this.getHasData()
406406

0 commit comments

Comments
 (0)