fix crash

Summary: blocks don't capture C++ objects so this will would crash

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D53572123

fbshipit-source-id: 323f29c30d99616080aef6b0a895df4599788395
This commit is contained in:
Phillip Pan
2024-02-08 12:24:48 -08:00
committed by Facebook GitHub Bot
parent 2ca7bec0c2
commit b796cda38b
@@ -84,6 +84,7 @@ RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback
NSString *destructiveButtonKey = [RCTConvert NSString:args.destructiveButtonKey()];
NSString *preferredButtonKey = [RCTConvert NSString:args.preferredButtonKey()];
UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()];
UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];
if (!title && !message) {
RCTLogError(@"Must specify either an alert title, or message, or both");
@@ -108,7 +109,6 @@ RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback
message:nil
preferredStyle:UIAlertControllerStyleAlert];
UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];
alertController.overrideUserInterfaceStyle = userInterfaceStyle;
switch (type) {