fix(opener): invoke the mobile plugin in the commands too (#2234) (#2332)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
pull/2324/head
Didrik Nordström 5 months ago committed by GitHub
parent 125ec1dbcf
commit 5b82118158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,6 @@
---
"opener": patch
"opener-js": patch
---
Fix broken JS commands `opener.openPath` and `opener.openUrl` on mobile.

@ -9,7 +9,7 @@ use tauri::{
AppHandle, Runtime,
};
use crate::{scope::Scope, Error};
use crate::{scope::Scope, Error, OpenerExt};
#[tauri::command]
pub async fn open_url<R: Runtime>(
@ -34,7 +34,7 @@ pub async fn open_url<R: Runtime>(
);
if scope.is_url_allowed(&url, with.as_deref()) {
crate::open_url(url, with)
app.opener().open_url(url, with)
} else {
Err(Error::ForbiddenUrl { url, with })
}
@ -63,7 +63,7 @@ pub async fn open_path<R: Runtime>(
);
if scope.is_path_allowed(Path::new(&path), with.as_deref())? {
crate::open_path(path, with)
app.opener().open_path(path, with)
} else {
Err(Error::ForbiddenPath { path, with })
}

Loading…
Cancel
Save