소스 검색

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

Lucas Fernandes Nogueira 2 년 전
부모
커밋
9de897919a
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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) => {