aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/Service.ts
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2024-05-13 22:47:35 +0100
committerLibravatar GitHub <noreply@github.com>2024-05-13 22:47:35 +0100
commit6167b6c7e9f49adee065646e2d28e28500753ebd (patch)
tree15d4746188e95af98ae7cf6e426c82ffdfed7ee1 /src/models/Service.ts
parentFix notifications on all services (#1593) (diff)
downloadferdium-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/Service.ts')
-rw-r--r--src/models/Service.ts13
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';
7import { v4 as uuidV4 } from 'uuid'; 7import { v4 as uuidV4 } from 'uuid';
8import { needsToken } from '../api/apiBase'; 8import { needsToken } from '../api/apiBase';
9import { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } from '../config'; 9import { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } from '../config';
10import { isMac } from '../environment';
10import { todosStore } from '../features/todos'; 11import { todosStore } from '../features/todos';
11import { getFaviconUrl } from '../helpers/favicon-helpers'; 12import { getFaviconUrl } from '../helpers/favicon-helpers';
12import { isValidExternalURL, normalizedUrl } from '../helpers/url-helpers'; 13import { 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