SDA-4394: Log wont be triggered as always while typing in RTE / Any input (#2016)

This commit is contained in:
NguyenTranHoangSym 2023-11-17 16:19:29 +07:00 committed by GitHub
parent 4611f66143
commit 2d1670db82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,6 +253,7 @@ export class WindowHandler {
'enableRendererLogs',
'enableBrowserLogin',
'browserLoginAutoConnect',
'devToolsEnabled',
]);
logger.info(
`window-handler: main windows initialized with following config data`,
@ -461,7 +462,6 @@ export class WindowHandler {
windowHandler.switchClient(clientSwitchType);
}, SHORTCUT_KEY_THROTTLE);
this.mainWebContents.on('before-input-event', (event, input) => {
const { devToolsEnabled } = config.getConfigFields(['devToolsEnabled']);
const windowsDevTools =
input.control && input.shift && input.key.toLowerCase() === 'i';
const macDevTools =
@ -469,7 +469,10 @@ export class WindowHandler {
if (input.control && input.shift && input.key.toLowerCase() === 'd') {
event.preventDefault();
throttledExportLogs();
} else if (devToolsEnabled && (windowsDevTools || macDevTools)) {
} else if (
this.config.devToolsEnabled &&
(windowsDevTools || macDevTools)
) {
event.preventDefault();
this.mainWebContents?.toggleDevTools();
}