Skip to content

Commit

Permalink
fix(shell): make execute command async (#1362)
Browse files Browse the repository at this point in the history
closes #1361
  • Loading branch information
amrbashir authored May 22, 2024
1 parent cfb3d74 commit aff4799
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/shell-execute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shell": "patch"
---

Run `Command.execute()` JS api, asynchronously in the Rust side to avoid blocking main thread and causing the webview to freeze.
2 changes: 1 addition & 1 deletion plugins/shell/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub struct ChildProcessReturn {

#[allow(clippy::too_many_arguments)]
#[tauri::command]
pub fn execute<R: Runtime>(
pub async fn execute<R: Runtime>(
window: Window<R>,
program: String,
args: ExecuteArgs,
Expand Down

0 comments on commit aff4799

Please sign in to comment.