Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eb37f68

Browse files
committedSep 6, 2022
improve primary button check
1 parent 1420c9b commit eb37f68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎arduino-ide-extension/src/browser/library/library-list-widget.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ class MessageBoxDialog extends AbstractDialog<MessageBoxDialog.Result> {
201201
options.buttons || [nls.localize('vscode/issueMainService/ok', 'OK')]
202202
).forEach((text, index) => {
203203
const button = this.createButton(text);
204-
const i = options.buttons ? options.buttons?.length - 1 : 0;
205-
button.classList.add(index === i ? 'main' : 'secondary');
204+
const isPrimaryButton =
205+
index === (options.buttons ? options.buttons?.length - 1 : 0);
206+
button.classList.add(isPrimaryButton ? 'main' : 'secondary');
206207
this.controlPanel.appendChild(button);
207208
this.toDisposeOnDetach.push(
208209
addEventListener(button, 'click', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.