Skip to content

Commit 4874316

Browse files
committed
fix: apply mod-warning class directly in the pre-1.13 confirm fallback
The review bot statically flags any setWarning() call site even behind a version gate. The deprecated method only added the mod-warning class, so the fallback adds the class itself and no deprecated API remains.
1 parent 4c383cf commit 4874316

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/shared/modals/confirm-modal.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ class ConfirmModal extends Modal {
4747
this.resolve(true);
4848
this.close();
4949
});
50-
// setDestructive replaced setWarning in 1.13; keep the deprecated
51-
// call on older installs covered by minAppVersion.
50+
// setDestructive replaced setWarning in 1.13. On older installs
51+
// covered by minAppVersion, apply the class the deprecated
52+
// setWarning() used to add instead of calling the API.
5253
if (requireApiVersion('1.13.0')) {
5354
btn.setDestructive();
5455
} else {
55-
btn.setWarning();
56+
btn.buttonEl.addClass('mod-warning');
5657
}
5758
});
5859
}

0 commit comments

Comments
 (0)