Skip to content

Commit 5b82118

Browse files
betamosFabianLars
andauthored
fix(opener): invoke the mobile plugin in the commands too (#2234) (#2332)
Co-authored-by: Fabian-Lars <[email protected]>
1 parent 125ec1d commit 5b82118

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changes/opener-mobile-fix.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"opener": patch
3+
"opener-js": patch
4+
---
5+
6+
Fix broken JS commands `opener.openPath` and `opener.openUrl` on mobile.

plugins/opener/src/commands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tauri::{
99
AppHandle, Runtime,
1010
};
1111

12-
use crate::{scope::Scope, Error};
12+
use crate::{scope::Scope, Error, OpenerExt};
1313

1414
#[tauri::command]
1515
pub async fn open_url<R: Runtime>(
@@ -34,7 +34,7 @@ pub async fn open_url<R: Runtime>(
3434
);
3535

3636
if scope.is_url_allowed(&url, with.as_deref()) {
37-
crate::open_url(url, with)
37+
app.opener().open_url(url, with)
3838
} else {
3939
Err(Error::ForbiddenUrl { url, with })
4040
}
@@ -63,7 +63,7 @@ pub async fn open_path<R: Runtime>(
6363
);
6464

6565
if scope.is_path_allowed(Path::new(&path), with.as_deref())? {
66-
crate::open_path(path, with)
66+
app.opener().open_path(path, with)
6767
} else {
6868
Err(Error::ForbiddenPath { path, with })
6969
}

0 commit comments

Comments
 (0)