fix: does not register global shortcut when quick ask is disabled (#2592)

This commit is contained in:
Louis 2024-04-03 13:56:23 +07:00 committed by GitHub
parent 3b755f7e8c
commit 8926c13696
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,6 +83,8 @@ app.on('second-instance', (_event, _commandLine, _workingDirectory) => {
})
app.on('ready', () => {
if (!getAppConfigurations().quick_ask) return
registerGlobalShortcuts()
})
@ -119,8 +121,6 @@ function createMainWindow() {
function registerGlobalShortcuts() {
const ret = registerShortcut(quickAskHotKey, (selectedText: string) => {
// Feature Toggle for Quick Ask
if (!getAppConfigurations().quick_ask) return
if (!windowManager.isQuickAskWindowVisible()) {
windowManager.showQuickAskWindow()
windowManager.sendQuickAskSelectedText(selectedText)