Skip to content

Commit

Permalink
fix double serialize on invoke (#5639)
Browse files Browse the repository at this point in the history
Co-authored-by: LucasJavaudin <lucas.javaudin@cyu.fr>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
  • Loading branch information
3 people committed Nov 20, 2022
1 parent 168c3d0 commit 677838c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-invoke-double-serialize.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Fixes a double serialization on the IPC.
6 changes: 5 additions & 1 deletion core/tauri/src/hooks.rs
Expand Up @@ -193,7 +193,11 @@ impl<R: Runtime> InvokeResolver<R> {
F: Future<Output = Result<JsonValue, InvokeError>> + Send + 'static,
{
crate::async_runtime::spawn(async move {
Self::return_result(self.window, task.await.into(), self.callback, self.error)
let response = match task.await {
Ok(ok) => InvokeResponse::Ok(ok),
Err(err) => InvokeResponse::Err(err),
};
Self::return_result(self.window, response, self.callback, self.error)
});
}

Expand Down

0 comments on commit 677838c

Please sign in to comment.