mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-14 16:37:27 +00:00
Bug #1211 When click Open Devtools turns already-opened devtools white
This commit is contained in:
parent
e32d1c309a
commit
0b87dd750e
1 changed files with 8 additions and 3 deletions
|
@ -205,10 +205,15 @@ const Device = ({ isPrimary, device, setIndividualDevice }: Props) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const webview = ref.current as Electron.WebviewTag;
|
const webview = ref.current as Electron.WebviewTag;
|
||||||
|
const isOpenedCurrentDevTool =
|
||||||
if (webview == null) {
|
devtoolsOpenForWebviewId === webview.getWebContentsId();
|
||||||
|
if (webview == null || isOpenedCurrentDevTool) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!isOpenedCurrentDevTool && devtoolsOpenForWebviewId !== -1) {
|
||||||
|
await window.electron.ipcRenderer.invoke('close-devtools');
|
||||||
|
dispatch(setDevtoolsClose());
|
||||||
|
}
|
||||||
await window.electron.ipcRenderer.invoke<
|
await window.electron.ipcRenderer.invoke<
|
||||||
OpenDevtoolsArgs,
|
OpenDevtoolsArgs,
|
||||||
OpenDevtoolsResult
|
OpenDevtoolsResult
|
||||||
|
@ -217,7 +222,7 @@ const Device = ({ isPrimary, device, setIndividualDevice }: Props) => {
|
||||||
dockPosition,
|
dockPosition,
|
||||||
});
|
});
|
||||||
dispatch(setDevtoolsOpen(webview.getWebContentsId()));
|
dispatch(setDevtoolsOpen(webview.getWebContentsId()));
|
||||||
}, [dispatch, dockPosition]);
|
}, [devtoolsOpenForWebviewId, dispatch, dockPosition]);
|
||||||
|
|
||||||
const inspectElement = useCallback(
|
const inspectElement = useCallback(
|
||||||
async (deviceX: number, deviceY: number) => {
|
async (deviceX: number, deviceY: number) => {
|
||||||
|
|
Loading…
Reference in a new issue