Skip to content

Commit

Permalink
fix(core): iOS plugin freezing when receiving a bool parameter (#6700)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Apr 13, 2023
1 parent abc5f91 commit 9de8979
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-plugin-ios-bool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Fixes boolean plugin parameters freezing the application.
3 changes: 2 additions & 1 deletion core/tauri/src/ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ unsafe fn add_json_entry_to_dictionary(data: id, key: String, value: JsonValue)
let () = msg_send![data, setObject:null forKey: key];
}
JsonValue::Bool(val) => {
let value = if val { YES } else { NO };
let flag = if val { YES } else { NO };
let value: id = msg_send![class!(NSNumber), numberWithBool: flag];
let () = msg_send![data, setObject:value forKey: key];
}
JsonValue::Number(val) => {
Expand Down

0 comments on commit 9de8979

Please sign in to comment.