Reduce the number of onUpdate events fired for dialog buttons (#16311)

This commit is contained in:
Charles Gagnon
2021-07-19 13:20:36 -07:00
committed by GitHub
parent eaba5679d4
commit 379c60dd27
2 changed files with 30 additions and 19 deletions

View File

@@ -161,19 +161,10 @@ export class MainThreadModelViewDialog extends Disposable implements MainThreadM
let button = this._buttons.get(handle);
if (!button) {
button = new DialogButton(details.label, details.enabled);
button.position = details.position;
button.hidden = details.hidden;
button.secondary = details.secondary;
button.onClick(() => this.onButtonClick(handle));
this._buttons.set(handle, button);
} else {
button.label = details.label;
button.enabled = details.enabled;
button.hidden = details.hidden;
button.focused = details.focused;
button.position = details.position;
button.secondary = details.secondary;
}
button.setProperties(details);
return Promise.resolve();
}