Skip to content

Commit 9de8979

Browse files
authored
fix(core): iOS plugin freezing when receiving a bool parameter (#6700)
1 parent abc5f91 commit 9de8979

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changes/fix-plugin-ios-bool.md

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 boolean plugin parameters freezing the application.

core/tauri/src/ios.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ unsafe fn add_json_entry_to_dictionary(data: id, key: String, value: JsonValue)
131131
let () = msg_send![data, setObject:null forKey: key];
132132
}
133133
JsonValue::Bool(val) => {
134-
let value = if val { YES } else { NO };
134+
let flag = if val { YES } else { NO };
135+
let value: id = msg_send![class!(NSNumber), numberWithBool: flag];
135136
let () = msg_send![data, setObject:value forKey: key];
136137
}
137138
JsonValue::Number(val) => {

0 commit comments

Comments
 (0)