mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-12 23:47:06 +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;
|
||||
}
|
||||
const webview = ref.current as Electron.WebviewTag;
|
||||
|
||||
if (webview == null) {
|
||||
const isOpenedCurrentDevTool =
|
||||
devtoolsOpenForWebviewId === webview.getWebContentsId();
|
||||
if (webview == null || isOpenedCurrentDevTool) {
|
||||
return;
|
||||
}
|
||||
if (!isOpenedCurrentDevTool && devtoolsOpenForWebviewId !== -1) {
|
||||
await window.electron.ipcRenderer.invoke('close-devtools');
|
||||
dispatch(setDevtoolsClose());
|
||||
}
|
||||
await window.electron.ipcRenderer.invoke<
|
||||
OpenDevtoolsArgs,
|
||||
OpenDevtoolsResult
|
||||
|
@ -217,7 +222,7 @@ const Device = ({ isPrimary, device, setIndividualDevice }: Props) => {
|
|||
dockPosition,
|
||||
});
|
||||
dispatch(setDevtoolsOpen(webview.getWebContentsId()));
|
||||
}, [dispatch, dockPosition]);
|
||||
}, [devtoolsOpenForWebviewId, dispatch, dockPosition]);
|
||||
|
||||
const inspectElement = useCallback(
|
||||
async (deviceX: number, deviceY: number) => {
|
||||
|
|
Loading…
Reference in a new issue