Răsfoiți Sursa

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

Lucas Fernandes Nogueira 2 ani în urmă
părinte
comite
9de897919a
2 a modificat fișierele cu 7 adăugiri și 1 ștergeri
  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) => {