mirror of https://github.com/status-im/metro.git
[RN Debugger] Don't try to handle messages without a method
Summary: Some messages are special and are intended for the devtools, like `{$open: id}` and `{$error: id}`. The main debugger-ui page can't handle these and thinks something is wrong when `object.method` is undefined. This diff handles messages only if they specify a method. Fixes #2377 Closes https://github.com/facebook/react-native/pull/2405 Github Author: James Ide <ide@jameside.com>
This commit is contained in:
parent
217f12a08f
commit
26a028e98d
|
@ -85,6 +85,10 @@ function connectToDebuggerProxy() {
|
||||||
|
|
||||||
ws.onmessage = function(message) {
|
ws.onmessage = function(message) {
|
||||||
var object = JSON.parse(message.data);
|
var object = JSON.parse(message.data);
|
||||||
|
if (!object.method) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var sendReply = function(result) {
|
var sendReply = function(result) {
|
||||||
ws.send(JSON.stringify({replyID: object.id, result: result}));
|
ws.send(JSON.stringify({replyID: object.id, result: result}));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue