Skip to content

Commit 822999a

Browse files
committed
feat: set url for native notification
Signed-off-by: Adam Setch <[email protected]>
1 parent 05f92dd commit 822999a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/renderer/utils/notifications/native.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { APPLICATION } from '../../../shared/constants';
33
import type { AccountNotifications, GitifyState } from '../../types';
44
import type { Notification } from '../../typesGitHub';
55
import { getAccountUUID } from '../auth/utils';
6+
import { generateGitHubWebUrl } from '../helpers';
67
import { setTrayIconColor } from './notifications';
78

89
export const triggerNativeNotifications = (
@@ -50,18 +51,20 @@ export const triggerNativeNotifications = (
5051
}
5152
};
5253

53-
export const raiseNativeNotification = (notifications: Notification[]) => {
54+
export const raiseNativeNotification = async (
55+
notifications: Notification[],
56+
) => {
5457
let title: string;
5558
let body: string;
56-
const url: string = null;
59+
let url: string = null;
5760

5861
if (notifications.length === 1) {
5962
const notification = notifications[0];
6063
title = window.gitify.platform.isWindows()
6164
? ''
6265
: notification.repository.full_name;
6366
body = notification.subject.title;
64-
// url intentionally left null (no direct subject URL available)
67+
url = await generateGitHubWebUrl(notification);
6568
} else {
6669
title = APPLICATION.NAME;
6770
body = `You have ${notifications.length} notifications`;

0 commit comments

Comments
 (0)