From 80f72c5e583dc5778614bdd5b63d1745abd8fc85 Mon Sep 17 00:00:00 2001 From: Deepak Jacob Date: Fri, 14 Jul 2023 11:52:11 -0700 Subject: [PATCH] Clear bundler banner messages after a certain delay during development. Summary: Changelog: [General] [iOS] Clear bundler banner messages after a certain delay during development. Differential Revision: D47478373 fbshipit-source-id: 0a1f2750d7fd54a1302cd6b9049b0789e9d3143b --- packages/react-native/React/CoreModules/RCTDevLoadingView.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 02bdb96e1d507c..a80e9fd7b503fc 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -132,6 +132,11 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( UIWindowScene *scene = (UIWindowScene *)RCTSharedApplication().connectedScenes.anyObject; self->_window.windowScene = scene; }); + + // Cancel previous hide call after the delay. + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hide) object:nil]; + // Set new hide call after a delay. + [self performSelector:@selector(hide) withObject:nil afterDelay:30.0]; } RCT_EXPORT_METHOD(showMessage