Skip to content

Commit 36088a1

Browse files
authored
consolidating updateState() calls (#18138)
1 parent 6b2aa9a commit 36088a1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/controllers/executionPlanWebviewController.ts

-4
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,4 @@ export class ExecutionPlanWebviewController extends ReactWebviewPanelController<
165165
}
166166
return sum;
167167
}
168-
169-
private updateState() {
170-
this.state = this.state;
171-
}
172168
}

src/controllers/reactWebviewBaseController.ts

+8
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ export abstract class ReactWebviewBaseController<State, Reducers>
285285
this.postNotification(DefaultWebviewNotifications.updateState, value);
286286
}
287287

288+
/**
289+
* Updates the state in the webview
290+
* @param state The new state object. If not provided, `this.state` is used.
291+
*/
292+
public updateState(state?: State) {
293+
this.state = state ?? this.state;
294+
}
295+
288296
/**
289297
* Gets whether the controller has been disposed
290298
*/

src/nps/userSurvey.ts

-4
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ class UserSurveyWebviewController extends ReactWebviewPanelController<
232232
this._onCancel.fire();
233233
});
234234
}
235-
236-
updateState(state: UserSurveyState): void {
237-
this.state = state;
238-
}
239235
}
240236

241237
export function getStandardNPSQuestions(featureName?: string): UserSurveyState {

0 commit comments

Comments
 (0)