File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ - (NSDictionary *)getConstants
4343 NSWindow *window = RCTKeyWindow ();
4444#endif
4545 if (window == nil ) {
46- // Try to retrieve cached metrics from NSUserDefaults
4746 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults ];
4847 NSDictionary *cachedMetrics = [defaults objectForKey: kSafeAreaInitialMetricsKey ];
4948
@@ -78,11 +77,10 @@ - (NSDictionary *)getConstants
7877 },
7978 };
8079
81- // Only cache the metrics if they haven't been cached before
8280 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults ];
8381 if ([defaults objectForKey: kSafeAreaInitialMetricsKey ] == nil ) {
8482 [defaults setObject: windowMetrics forKey: kSafeAreaInitialMetricsKey ];
85- [defaults synchronize ]; // Ensure it's persisted immediately
83+ [defaults synchronize ];
8684 NSLog (@" RNCSafeAreaContext: cached initial window metrics to NSUserDefaults for the first time" );
8785 }
8886
You can’t perform that action at this time.
0 commit comments