This commit is contained in:
Dan
2019-04-08 23:28:31 +01:00
parent c91676b557
commit 7aecd58d81
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ function createPanelIfReactLoaded() {
if (error) {
console.error(error);
} else if (didChangeSelection) {
bridge.send('syncSelectionFromBrowserTools');
bridge.send('syncSelectionFromNativeElementsPanel');
}
}
);
+4 -5
View File
@@ -88,8 +88,8 @@ export default class Agent extends EventEmitter {
bridge.addListener('stopInspectingDOM', this.stopInspectingDOM);
bridge.addListener('stopProfiling', this.stopProfiling);
bridge.addListener(
'syncSelectionFromBrowserTools',
this.syncSelectionFromBrowserTools
'syncSelectionFromNativeElementsPanel',
this.syncSelectionFromNativeElementsPanel
);
bridge.addListener('shutdown', this.shutdown);
bridge.addListener('viewElementSource', this.viewElementSource);
@@ -299,8 +299,7 @@ export default class Agent extends EventEmitter {
// Update the active DOM node on the global hook object.
// The content script will read this to update window.$0
// when we switch tabs.
let node: HTMLElement | null = null;
node = ((renderer.findNativeByFiberID(id): any): HTMLElement);
const node = ((renderer.findNativeByFiberID(id): any): HTMLElement);
if (node !== null) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 = node;
}
@@ -375,7 +374,7 @@ export default class Agent extends EventEmitter {
}
}
syncSelectionFromBrowserTools = () => {
syncSelectionFromNativeElementsPanel = () => {
const target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;
if (target == null) {
return;