mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
fix(dialog): browser confirm fails with command not found (#3665)
This commit is contained in:
3 files changed
+13
-4
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
dialog: patch
|
||||
dialog-js: patch
|
||||
---
|
||||
|
||||
Fix browser `confirm` fails with `Uncaught dialog.confirm not allowed. Command not found`
|
||||
@@ -19,7 +19,10 @@ window.alert = function (message: string) {
|
||||
|
||||
// @ts-expect-error tauri does not have sync IPC :(
|
||||
window.confirm = async function (message: string) {
|
||||
return await invoke('plugin:dialog|confirm', {
|
||||
message: message.toString()
|
||||
})
|
||||
return (
|
||||
(await invoke<string>('plugin:dialog|message', {
|
||||
message: message.toString(),
|
||||
buttons: 'OkCancel'
|
||||
})) === 'Ok'
|
||||
)
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
!function(){"use strict";async function n(n,i={},o){return window.__TAURI_INTERNALS__.invoke(n,i,o)}"function"==typeof SuppressedError&&SuppressedError,window.alert=function(i){n("plugin:dialog|message",{message:i.toString()})},window.confirm=async function(i){return await n("plugin:dialog|confirm",{message:i.toString()})}}();
|
||||
!function(){"use strict";async function n(n,e={},i){return window.__TAURI_INTERNALS__.invoke(n,e,i)}"function"==typeof SuppressedError&&SuppressedError,window.alert=function(e){n("plugin:dialog|message",{message:e.toString()})},window.confirm=async function(e){return"Ok"===await n("plugin:dialog|message",{message:e.toString(),buttons:"OkCancel"})}}();
|
||||
Reference in new issue
Block a user