Skip to content

Commit

Permalink
fix permissions error
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Nov 14, 2024
1 parent 8ed396f commit 30dcce8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions examples/api/src/views/Opener.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@
export let onMessage
let url = ''
let path = ''
let revealPath = ''
let urlProgram = 'Default'
let pathProgram = 'Default'
let urlProgram = ''
function openUrl() {
opener.openUrl(url, urlProgram ? urlProgram : undefined).catch(onMessage)
}
let path = ''
let pathProgram = ''
function openPath() {
opener
.openPath(path, pathProgram ? pathProgram : undefined)
.catch(onMessage)
}
let revealPath = ''
function revealItemInDir() {
opener.revealItemInDir(revealPath).catch(onMessage)
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/opener/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub enum Error {
Json(#[from] serde_json::Error),
#[error("unknown program {0}")]
UnknownProgramName(String),
#[error("Not allowed to open path {0}{}", .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())]
#[error("Not allowed to open path {}{}", .path, .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())]
ForbiddenPath { path: String, with: Option<String> },
#[error("Not allowed to open url {0}{}", .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())]
#[error("Not allowed to open url {}{}", .url, .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())]
ForbiddenUrl { url: String, with: Option<String> },
#[error("API not supported on the current platform")]
UnsupportedPlatform,
Expand Down

0 comments on commit 30dcce8

Please sign in to comment.