summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-05-20 21:21:54 +0200
committerSebastian Holmin <sebastian.holmin@mullvad.net>2025-05-28 13:25:41 +0200
commit2e2fefef3639b42bb9b4c068b82652c62e255f25 (patch)
tree8c2b33f0583cefac5a9a4c3878c607f3096c5e1e
parent6cd4cad8e80e66a3945c76e40023e00c9008819d (diff)
downloadmullvadvpn-2e2fefef3639b42bb9b4c068b82652c62e255f25.tar.xz
mullvadvpn-2e2fefef3639b42bb9b4c068b82652c62e255f25.zip
Add handling of 'navigate-internal' system notification action
-rw-r--r--desktop/packages/mullvad-vpn/src/main/notification-controller.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/desktop/packages/mullvad-vpn/src/main/notification-controller.ts b/desktop/packages/mullvad-vpn/src/main/notification-controller.ts
index 1a04c99140..9f49d3ca07 100644
--- a/desktop/packages/mullvad-vpn/src/main/notification-controller.ts
+++ b/desktop/packages/mullvad-vpn/src/main/notification-controller.ts
@@ -17,6 +17,7 @@ import {
SystemNotificationProvider,
SystemNotificationSeverityType,
} from '../shared/notifications';
+import { RoutePath } from '../shared/routes';
import { Scheduler } from '../shared/scheduler';
const THROTTLE_DELAY = 500;
@@ -34,6 +35,7 @@ export interface NotificationSender {
export interface NotificationControllerDelegate {
openApp(): void;
openLink(url: string, withAuth?: boolean): Promise<void>;
+ openRoute(url: RoutePath): void;
/**
* We have experienced issues where the
* notification dot wasn't removed and logging the reason for it to be showing we can narrow the
@@ -269,8 +271,15 @@ export default class NotificationController {
}
private performAction(action?: SystemNotificationAction) {
- if (action && action.type === 'navigate-external') {
- void this.notificationControllerDelegate.openLink(action.link.to, action.link.withAuth);
+ if (action) {
+ if (action.type === 'navigate-external') {
+ void this.notificationControllerDelegate.openLink(action.link.to, action.link.withAuth);
+ }
+
+ if (action.type === 'navigate-internal') {
+ void this.notificationControllerDelegate.openRoute(action.link.to);
+ this.notificationControllerDelegate.openApp();
+ }
}
}