Commit 7afc8b8
disable "Open Debugger" menu item if the bundler is disconnected (#42876)
Summary:
Pull Request resolved: #42876
Changelog:
[Android][Fixed] Disable the "Open Debugger" item from dev menu if the bundler is disconnected
# Existing
In our dev menu, the "Open Debugger" menu item is shown even if the packager isn't connected.
{F1451833462}
# In this PR
The "Open Debugger" menu item is disabled when the packager is disconnected with the message "Connect to the bundler to debug JavaScript"
{F1451834019}
# Reference
* There are existing checks, but they're async. We don't need the check to be accurate; and we don't want to delay the dev menu from opening
* [isMetroRunning()](https://github.com/facebook/react-native/blob/db066acfe3994787d706ad082ce718a91b8249f5/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java#L1013-L1027)
* [isPackagerRunning(…)](https://github.com/facebook/react-native/blob/db066acfe3994787d706ad082ce718a91b8249f5/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java#L798-L805)
* Also on iOS: D53354110
Reviewed By: hoxyq
Differential Revision: D53428914
fbshipit-source-id: 3e70d7fec9fc8fc63a8519c5385a91775febce9a1 parent d7dce97 commit 7afc8b8
File tree
2 files changed
+42
-5
lines changed- packages/react-native/ReactAndroid/src/main
- java/com/facebook/react/devsupport
- res/devsupport/values
2 files changed
+42
-5
lines changedLines changed: 41 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
340 | 346 | | |
341 | 347 | | |
342 | 348 | | |
| 349 | + | |
343 | 350 | | |
344 | 351 | | |
345 | 352 | | |
| |||
369 | 376 | | |
370 | 377 | | |
371 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
372 | 386 | | |
373 | | - | |
| 387 | + | |
374 | 388 | | |
375 | 389 | | |
376 | 390 | | |
| |||
505 | 519 | | |
506 | 520 | | |
507 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
508 | 544 | | |
509 | 545 | | |
510 | 546 | | |
511 | | - | |
512 | | - | |
| 547 | + | |
| 548 | + | |
513 | 549 | | |
514 | 550 | | |
515 | 551 | | |
| |||
1022 | 1058 | | |
1023 | 1059 | | |
1024 | 1060 | | |
1025 | | - | |
| 1061 | + | |
1026 | 1062 | | |
1027 | 1063 | | |
1028 | 1064 | | |
1029 | 1065 | | |
1030 | | - | |
| 1066 | + | |
1031 | 1067 | | |
1032 | 1068 | | |
1033 | 1069 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments