fix(dialog): ask and confirm not using system button texts (#1910)

* Fix `ask`'s button texts being ok and cancel

* Update change file
This commit is contained in:
Tony
2024-10-20 08:48:45 -03:00
committed by GitHub
parent 44c50c1275
commit 2302c2db1c
7 changed files with 40 additions and 26 deletions
+3
View File
@@ -43,6 +43,8 @@ use mobile::*;
pub(crate) const OK: &str = "Ok";
pub(crate) const CANCEL: &str = "Cancel";
pub(crate) const YES: &str = "Yes";
pub(crate) const NO: &str = "No";
macro_rules! blocking_fn {
($self:ident, $fn:ident) => {{
@@ -236,6 +238,7 @@ impl<R: Runtime> MessageDialogBuilder<R> {
let (ok_button_label, cancel_button_label) = match &self.buttons {
MessageDialogButtons::Ok => (Some(OK), None),
MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)),
MessageDialogButtons::YesNo => (Some(YES), Some(NO)),
MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)),
MessageDialogButtons::OkCancelCustom(ok, cancel) => {
(Some(ok.as_str()), Some(cancel.as_str()))