Fix PerfMonitor appearance when reloading JS (#24073)

Summary:
Fix for this issue I rasied: https://github.com/facebook/react-native/issues/24024
When I toggle `Show Perf Monitor` and reload JS `CMD+R` the Perf Monitor will be hidden, but settings in dev menu will persist. So to fix this state and need to `Hide Perf Monitor` and `Show Perf Monitor` again to see it.

[iOS] [Fixed] - Show Perf Monitor, after reloading JS
Pull Request resolved: https://github.com/facebook/react-native/pull/24073

Differential Revision: D14560025

Pulled By: cpojer

fbshipit-source-id: cd5602bd6ee041b8b3e61d163d10bd8bc47237b9
This commit is contained in:
Lukas Kurucz 2019-03-21 03:17:58 -07:00 committed by Lorenzo Sciandra
parent e4f9ee913b
commit bdf809e817

View File

@ -156,6 +156,9 @@ RCT_EXPORT_MODULE()
if (!_devMenuItem) {
__weak __typeof__(self) weakSelf = self;
__weak RCTDevSettings *devSettings = self.bridge.devSettings;
if (devSettings.isPerfMonitorShown) {
[weakSelf show];
}
_devMenuItem =
[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{
return (devSettings.isPerfMonitorShown) ?