Skip to content

Commit

Permalink
SDA-4394: Log wont be triggered as always while typing in RTE / Any i…
Browse files Browse the repository at this point in the history
…nput (#2016)
  • Loading branch information
NguyenTranHoangSym authored Nov 17, 2023
1 parent 4611f66 commit 2d1670d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/window-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export class WindowHandler {
'enableRendererLogs',
'enableBrowserLogin',
'browserLoginAutoConnect',
'devToolsEnabled',
]);
logger.info(
`window-handler: main windows initialized with following config data`,
Expand Down Expand Up @@ -461,15 +462,17 @@ 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 =
input.meta && input.alt && input.key.toLowerCase() === 'i';
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();
}
Expand Down

0 comments on commit 2d1670d

Please sign in to comment.