mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
CMD+R should post a refresh notification.
Summary: For the sake of consistency, `cmd+r` should just post a refresh notification. This way other tools can also observe and react to the refresh without ugly hacks. Closes https://github.com/facebook/react-native/pull/2175 Github Author: Tj <tfallon@mail.depaul.edu>
This commit is contained in:
parent
9edad17a15
commit
c933087567
@ -199,14 +199,16 @@ RCT_NOT_IMPLEMENTED(-init)
|
||||
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
|
||||
__weak RCTBridge *weakSelf = self;
|
||||
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
|
||||
|
||||
// reload in current mode
|
||||
[commands registerKeyCommandWithInput:@"r"
|
||||
modifierFlags:UIKeyModifierCommand
|
||||
action:^(__unused UIKeyCommand *command) {
|
||||
[weakSelf reload];
|
||||
action:^(__unused UIKeyCommand *command)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification
|
||||
object:nil
|
||||
userInfo:nil];
|
||||
}];
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user