From e706df7d03f38282fc035105eb5f4469cf4409fa Mon Sep 17 00:00:00 2001 From: Kris Scott Date: Thu, 26 Aug 2021 08:36:10 -0500 Subject: [PATCH] Fix svelte recipe packageManager ternary (#2534) * refactor: custom protocol (#2503) Co-authored-by: Lucas Nogueira * Apply Version Updates From Current Changes (#2513) Co-authored-by: lucasfernog * fix(api): revert ES2021 target * Apply Version Updates From Current Changes (#2520) Co-authored-by: lucasfernog * docs: webdriver guide (#2461) Co-authored-by: Ngo Iok Ui (Wu Yu Wei) * fix(core): `Notification.requestPermission()` deadlock regression * Fix packageManager ternary Co-authored-by: david Co-authored-by: Lucas Nogueira Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: lucasfernog Co-authored-by: chip Co-authored-by: Ngo Iok Ui (Wu Yu Wei) --- .changes/notification-regression.md | 5 +++++ core/tauri/src/endpoints.rs | 2 +- examples/api/src-tauri/Cargo.lock | 4 ++-- examples/updater/src-tauri/Cargo.lock | 4 ++-- tooling/create-tauri-app/src/recipes/svelte.ts | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changes/notification-regression.md diff --git a/.changes/notification-regression.md b/.changes/notification-regression.md new file mode 100644 index 000000000..2e2d1193d --- /dev/null +++ b/.changes/notification-regression.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fixes `Notification.requestPermission()` deadlock. diff --git a/core/tauri/src/endpoints.rs b/core/tauri/src/endpoints.rs index 3d7b4195c..10805efe2 100644 --- a/core/tauri/src/endpoints.rs +++ b/core/tauri/src/endpoints.rs @@ -126,7 +126,7 @@ impl Module { }) } } - Self::Notification(cmd) => resolver.respond_closure(move || { + Self::Notification(cmd) => resolver.respond_async(async move { cmd .run(window, config, &package_info) .and_then(|r| r.json) diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 6dc24b406..e56f9393a 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -3164,9 +3164,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b" +checksum = "92036be488bb6594459f2e03b60e42df6f937fe6ca5c5ffdcb539c6b84dc40f5" dependencies = [ "autocfg", "bytes", diff --git a/examples/updater/src-tauri/Cargo.lock b/examples/updater/src-tauri/Cargo.lock index 76b856947..b54634d09 100644 --- a/examples/updater/src-tauri/Cargo.lock +++ b/examples/updater/src-tauri/Cargo.lock @@ -3042,9 +3042,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b" +checksum = "92036be488bb6594459f2e03b60e42df6f937fe6ca5c5ffdcb539c6b84dc40f5" dependencies = [ "autocfg", "bytes", diff --git a/tooling/create-tauri-app/src/recipes/svelte.ts b/tooling/create-tauri-app/src/recipes/svelte.ts index c8365db39..d113aa4c1 100644 --- a/tooling/create-tauri-app/src/recipes/svelte.ts +++ b/tooling/create-tauri-app/src/recipes/svelte.ts @@ -31,10 +31,10 @@ const svelte: Recipe = { distDir: `../public`, devPath: 'http://localhost:5000', beforeDevCommand: `${ - packageManager === 'yarn' ? 'npm run' : packageManager + packageManager === 'npm' ? 'npm run' : packageManager } dev`, beforeBuildCommand: `${ - packageManager === 'yarn' ? 'npm run' : packageManager + packageManager === 'npm' ? 'npm run' : packageManager } build` }), preInit: async ({ cwd, cfg, answers }) => {