Skip to content

Commit 677838c

Browse files
LucasJavaudinLucasJavaudinlucasfernog
authored
fix double serialize on invoke (#5639)
Co-authored-by: LucasJavaudin <lucas.javaudin@cyu.fr> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
1 parent 168c3d0 commit 677838c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Fixes a double serialization on the IPC.

core/tauri/src/hooks.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ impl<R: Runtime> InvokeResolver<R> {
193193
F: Future<Output = Result<JsonValue, InvokeError>> + Send + 'static,
194194
{
195195
crate::async_runtime::spawn(async move {
196-
Self::return_result(self.window, task.await.into(), self.callback, self.error)
196+
let response = match task.await {
197+
Ok(ok) => InvokeResponse::Ok(ok),
198+
Err(err) => InvokeResponse::Err(err),
199+
};
200+
Self::return_result(self.window, response, self.callback, self.error)
197201
});
198202
}
199203

0 commit comments

Comments
 (0)