From 7186c4de4fc76e87fa1386f2839f178dd220a02b Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Thu, 28 Jan 2021 19:07:52 -0800 Subject: [PATCH] Only show DevMenu on shake if RCTView is visible Summary: Changelog: [iOS] Only show Dev Menu on shake if RN view is visible Reviewed By: fkgozali Differential Revision: D26138659 fbshipit-source-id: e2db287728675c7ead5fcbf569ed591638e2187e --- React/CoreModules/RCTDevMenu.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/React/CoreModules/RCTDevMenu.mm b/React/CoreModules/RCTDevMenu.mm index 2166d5034fac32..6ffd2ca9fc0dad 100644 --- a/React/CoreModules/RCTDevMenu.mm +++ b/React/CoreModules/RCTDevMenu.mm @@ -168,7 +168,13 @@ - (void)invalidate - (void)showOnShake { if ([((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]) isShakeToShowDevMenuEnabled]) { - [self show]; + for (UIWindow *window in [RCTSharedApplication() windows]) { + NSString *recursiveDescription = [window valueForKey:@"recursiveDescription"]; + if ([recursiveDescription containsString:@"RCTView"]) { + [self show]; + return; + } + } } }