Show warning instead of error on duplicate connection

Summary: Show warning instead of error on duplicate connection

Reviewed By: alexeylang

Differential Revision: D9117286

fbshipit-source-id: 81b135584bb3f44e37388de6df9d6386e5fb758a
This commit is contained in:
Nurzhan Bakibayev 2018-08-02 03:05:47 -07:00 committed by Facebook Github Bot
parent 1fb7a25f7b
commit 1b65c6d73a
1 changed files with 4 additions and 2 deletions

View File

@ -95,9 +95,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
- (void)handleConnect:(NSDictionary *)payload
{
NSString *pageId = payload[@"pageId"];
if (_inspectorConnections[pageId]) {
RCTInspectorLocalConnection *existingConnection = _inspectorConnections[pageId];
if (existingConnection) {
[_inspectorConnections removeObjectForKey:pageId];
RCTLogError(@"Already connected: %@", pageId);
[existingConnection disconnect];
RCTLogWarn(@"Already connected: %@", pageId);
return;
}