Skip to content

Commit 7186c4d

Browse files
Peter Arganyfacebook-github-bot
Peter Argany
authored andcommitted
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
1 parent b0ec350 commit 7186c4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

React/CoreModules/RCTDevMenu.mm

+7-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ - (void)invalidate
168168
- (void)showOnShake
169169
{
170170
if ([((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]) isShakeToShowDevMenuEnabled]) {
171-
[self show];
171+
for (UIWindow *window in [RCTSharedApplication() windows]) {
172+
NSString *recursiveDescription = [window valueForKey:@"recursiveDescription"];
173+
if ([recursiveDescription containsString:@"RCTView"]) {
174+
[self show];
175+
return;
176+
}
177+
}
172178
}
173179
}
174180

0 commit comments

Comments
 (0)