fix: dialog did not close after confirmation (#1628)

* fix: dialog did not close after confirmation

* i18n
This commit is contained in:
Eric Zhu 2024-11-16 23:00:20 +08:00 committed by GitHub
parent aceb4c964f
commit 6a5ec1b044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -120,8 +120,8 @@ export function createWindow(
const caller = callWindowExpose(window)
const confirm = await caller.dialog.ask({
title: "Open External App?",
message: t("dialog.openExternalApp", { url, interpolation: { escapeValue: false } }),
title: t("dialog.openExternalApp.title"),
message: t("dialog.openExternalApp.message", { url, interpolation: { escapeValue: false } }),
confirmText: t("dialog.open"),
cancelText: t("dialog.cancel"),
})

View File

@ -188,6 +188,7 @@ export const useDialog = (): DialogInstance => {
onClick={() => {
options.onConfirm?.()
resolve(true)
dismiss()
}}
>
{options.confirmText ?? t("confirm", { ns: "common" })}

View File

@ -23,7 +23,8 @@
"dialog.clearAllData": "Are you sure you want to clear all data?",
"dialog.no": "No",
"dialog.open": "Open",
"dialog.openExternalApp": "Are you sure you want to open \"{{url}}\" with other apps?",
"dialog.openExternalApp.message": "Are you sure you want to open \"{{url}}\" with other apps?",
"dialog.openExternalApp.title": "Open External App?",
"dialog.yes": "Yes",
"menu.about": "About {{name}}",
"menu.actualSize": "Actual Size",