mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 13:22:30 +03:00
fix(electron): do not always enable devtools detach mode (#8273)
This commit is contained in:
parent
714b7b863e
commit
7a26c76e53
@ -258,9 +258,7 @@ export async function openUrlInHiddenWindow(urlObj: URL) {
|
||||
});
|
||||
|
||||
if (BUILD_CONFIG.debug) {
|
||||
win.webContents.openDevTools({
|
||||
mode: 'detach',
|
||||
});
|
||||
win.webContents.openDevTools();
|
||||
}
|
||||
|
||||
win.on('close', e => {
|
||||
|
@ -817,9 +817,7 @@ export class WebContentViewsManager {
|
||||
|
||||
view.webContents.loadURL(shellViewUrl).catch(err => logger.error(err));
|
||||
if (isDev) {
|
||||
view.webContents.openDevTools({
|
||||
mode: 'detach',
|
||||
});
|
||||
view.webContents.openDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1003,17 +1001,13 @@ export const showDevTools = (id?: string) => {
|
||||
getCustomThemeWindow()
|
||||
.then(w => {
|
||||
if (w && w.isFocused()) {
|
||||
w.webContents.openDevTools({
|
||||
mode: 'detach',
|
||||
});
|
||||
w.webContents.openDevTools();
|
||||
} else {
|
||||
const view = id
|
||||
? WebContentViewsManager.instance.getViewById(id)
|
||||
: WebContentViewsManager.instance.activeWorkbenchView;
|
||||
if (view) {
|
||||
view.webContents.openDevTools({
|
||||
mode: 'detach',
|
||||
});
|
||||
view.webContents.openDevTools();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user