@@ -217,6 +217,11 @@ - (void)addItem:(RCTDevMenuItem *)item
217
217
alertControllerWithTitle: @" Remote JS Debugger Unavailable"
218
218
message: @" You need to include the RCTWebSocket library to enable remote JS debugging"
219
219
preferredStyle: UIAlertControllerStyleAlert];
220
+ __weak typeof (alertController) weakAlertController = alertController;
221
+ [alertController addAction:
222
+ [UIAlertAction actionWithTitle: @" OK" style: UIAlertActionStyleDefault handler: ^(UIAlertAction *action){
223
+ [weakAlertController dismissViewControllerAnimated: YES completion: nil ];
224
+ }]];
220
225
[RCTPresentedViewController () presentViewController: alertController animated: YES completion: NULL ];
221
226
}]];
222
227
} else {
@@ -241,7 +246,20 @@ - (void)addItem:(RCTDevMenuItem *)item
241
246
[items addObject: [RCTDevMenuItem buttonItemWithTitleBlock: ^NSString *{
242
247
return devSettings.isProfilingEnabled ? @" Stop Systrace" : @" Start Systrace" ;
243
248
} handler: ^{
244
- devSettings.isProfilingEnabled = !devSettings.isProfilingEnabled ;
249
+ if (devSettings.isDebuggingRemotely ) {
250
+ UIAlertController *alertController = [UIAlertController
251
+ alertControllerWithTitle: @" Systrace Unavailable"
252
+ message: @" You need to stop remote JS debugging to enable Systrace"
253
+ preferredStyle: UIAlertControllerStyleAlert];
254
+ __weak typeof (alertController) weakAlertController = alertController;
255
+ [alertController addAction:
256
+ [UIAlertAction actionWithTitle: @" OK" style: UIAlertActionStyleDefault handler: ^(UIAlertAction *action){
257
+ [weakAlertController dismissViewControllerAnimated: YES completion: nil ];
258
+ }]];
259
+ [RCTPresentedViewController () presentViewController: alertController animated: YES completion: NULL ];
260
+ } else {
261
+ devSettings.isProfilingEnabled = !devSettings.isProfilingEnabled ;
262
+ }
245
263
}]];
246
264
}
247
265
0 commit comments