Skip to content

Commit

Permalink
fix: attempt to use tauri's shell open
Browse files Browse the repository at this point in the history
Signed-off-by: Martichou <[email protected]>
  • Loading branch information
Martichou committed Aug 13, 2024
1 parent c35a06c commit fa63e82
Show file tree
Hide file tree
Showing 17 changed files with 867 additions and 868 deletions.
1 change: 0 additions & 1 deletion app/legacy/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/legacy/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ fern = { version = "0.6", features = ["colored"] }
humantime = "2.1"
log = "0.4"
notify-rust = "4.10"
open = "5.0"
rqs_lib = { path = "../../../core_lib", features = ["experimental"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
2 changes: 0 additions & 2 deletions app/legacy/src-tauri/src/cmds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mod discovery;
pub use discovery::*;
mod get_hostname;
pub use get_hostname::*;
mod open_url;
pub use open_url::*;
mod send_payload;
pub use send_payload::*;
mod send_to_rs;
Expand Down
17 changes: 0 additions & 17 deletions app/legacy/src-tauri/src/cmds/open_url.rs

This file was deleted.

1 change: 0 additions & 1 deletion app/legacy/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ async fn main() -> Result<(), anyhow::Error> {
cmds::start_discovery,
cmds::stop_discovery,
cmds::get_hostname,
cmds::open_url,
cmds::send_payload,
cmds::send_to_rs,
])
Expand Down
5 changes: 4 additions & 1 deletion app/legacy/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
"active": false
},
"allowlist": {
"all": true
"all": true,
"shell": {
"open": ".*"
}
},
"windows": [
{
Expand Down
3 changes: 2 additions & 1 deletion app/legacy/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ import { ref, nextTick } from 'vue'
import { UnlistenFn, listen } from '@tauri-apps/api/event'
import { Store } from 'tauri-plugin-store-api';
import { invoke } from '@tauri-apps/api/tauri'
import { open } from '@tauri-apps/api/shell';
import { getVersion } from '@tauri-apps/api/app';
import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification';
import { getCurrent } from '@tauri-apps/api/window';
Expand Down Expand Up @@ -587,7 +588,7 @@ export default {
},
openUrl: async function(url: string) {
try {
await invoke('open_url', { message: url });
await open(url);
} catch (e) {
this.toastStore.addToast("Error opening URL, it may not be a valid URI", ToastType.Error);
console.error("Error opening URL", e);
Expand Down
3 changes: 2 additions & 1 deletion app/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"@tauri-apps/plugin-dialog": "2.0.0-rc.0",
"@tauri-apps/plugin-notification": "2.0.0-rc.0",
"@tauri-apps/plugin-store": "2.0.0-rc.0",
"pinia": "^2.2.1",
"@tauri-apps/plugin-shell": "2.0.0-rc.0",
"pinia": "^2.2.0",
"semver": "^7.6.3",
"vue": "3.4.37"
},
Expand Down
10 changes: 10 additions & 0 deletions app/main/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fa63e82

Please sign in to comment.