Fix invoke calls in dialog & shell init scripts (#675)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
Mo
2023-10-22 10:09:40 -03:00
committed by GitHub
co-authored by Lucas Nogueira
parent 5c137365c6
commit beb6b139eb
14 changed files with 112 additions and 66 deletions
+18
View File
@@ -0,0 +1,18 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { invoke } from "@tauri-apps/api/primitives";
window.alert = function (message: string) {
invoke("plugin:dialog|message", {
message: message.toString(),
});
};
// @ts-expect-error tauri does not have sync IPC :(
window.confirm = function (message: string) {
return invoke("plugin:dialog|confirm", {
message: message.toString(),
});
};