mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-08 16:07:50 +02:00
feat: add init scripts (#361)
This commit is contained in:
committed by
GitHub
parent
d87b569643
commit
7ae7167fbe
@@ -69,7 +69,15 @@ impl<R: Runtime> Dialog<R> {
|
||||
|
||||
/// Initializes the plugin.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("dialog")
|
||||
let mut builder = Builder::new("dialog");
|
||||
|
||||
// Dialogs are implemented natively on Android
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
builder = builder.js_init_script(include_str!("init.js").to_string());
|
||||
}
|
||||
|
||||
builder
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::open,
|
||||
commands::save,
|
||||
|
||||
Reference in New Issue
Block a user