Explorar o código

fix(core): iOS plugin freezing when receiving a bool parameter (#6700)

Lucas Fernandes Nogueira %!s(int64=2) %!d(string=hai) anos
pai
achega
9de897919a
Modificáronse 2 ficheiros con 7 adicións e 1 borrados
  1. 5 0
      .changes/fix-plugin-ios-bool.md
  2. 2 1
      core/tauri/src/ios.rs

+ 5 - 0
.changes/fix-plugin-ios-bool.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fixes boolean plugin parameters freezing the application.

+ 2 - 1
core/tauri/src/ios.rs

@@ -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) => {