Skip to content

Commit

Permalink
fix(shell): make execute command async
Browse files Browse the repository at this point in the history
closes #1361
  • Loading branch information
amrbashir committed May 22, 2024
1 parent bc834d4 commit 2e6a627
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 @@ -187,7 +187,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 2e6a627

Please # to comment.