diff options
author | 2024-05-13 22:47:35 +0100 | |
---|---|---|
committer | 2024-05-13 22:47:35 +0100 | |
commit | 6167b6c7e9f49adee065646e2d28e28500753ebd (patch) | |
tree | 15d4746188e95af98ae7cf6e426c82ffdfed7ee1 /src/models | |
parent | Fix notifications on all services (#1593) (diff) | |
download | ferdium-app-6167b6c7e9f49adee065646e2d28e28500753ebd.tar.gz ferdium-app-6167b6c7e9f49adee065646e2d28e28500753ebd.tar.zst ferdium-app-6167b6c7e9f49adee065646e2d28e28500753ebd.zip |
Fix accelerators (#1752)
* fix: accelerators with numbers
* fix: control zoom in
* fix logic on macOS
* fix for linux
* chore: prepare-code
* chore: adjust comments
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/Service.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/models/Service.ts b/src/models/Service.ts index a61df5570..ae04b8b58 100644 --- a/src/models/Service.ts +++ b/src/models/Service.ts | |||
@@ -7,6 +7,7 @@ import type ElectronWebView from 'react-electron-web-view'; | |||
7 | import { v4 as uuidV4 } from 'uuid'; | 7 | import { v4 as uuidV4 } from 'uuid'; |
8 | import { needsToken } from '../api/apiBase'; | 8 | import { needsToken } from '../api/apiBase'; |
9 | import { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } from '../config'; | 9 | import { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } from '../config'; |
10 | import { isMac } from '../environment'; | ||
10 | import { todosStore } from '../features/todos'; | 11 | import { todosStore } from '../features/todos'; |
11 | import { getFaviconUrl } from '../helpers/favicon-helpers'; | 12 | import { getFaviconUrl } from '../helpers/favicon-helpers'; |
12 | import { isValidExternalURL, normalizedUrl } from '../helpers/url-helpers'; | 13 | import { isValidExternalURL, normalizedUrl } from '../helpers/url-helpers'; |
@@ -536,6 +537,18 @@ export default class Service { | |||
536 | }); | 537 | }); |
537 | 538 | ||
538 | if (webviewWebContents) { | 539 | if (webviewWebContents) { |
540 | // TODO: Modify this logic once https://github.com/electron/electron/issues/40674 is fixed | ||
541 | // This is a workaround for the issue where the zoom in shortcut is not working | ||
542 | if (!isMac) { | ||
543 | webviewWebContents.on('before-input-event', (event, input) => { | ||
544 | if (input.control && input.key === '+' && input.type === 'keyDown') { | ||
545 | event.preventDefault(); | ||
546 | const currentZoom = this.webview?.getZoomLevel(); | ||
547 | this.webview?.setZoomLevel(currentZoom + 0.5); | ||
548 | } | ||
549 | }); | ||
550 | } | ||
551 | |||
539 | webviewWebContents.session.on('will-download', (event, item) => { | 552 | webviewWebContents.session.on('will-download', (event, item) => { |
540 | event.preventDefault(); | 553 | event.preventDefault(); |
541 | 554 | ||