Skip to content

Commit e42fd54

Browse files
committed
lint
1 parent b4eecd2 commit e42fd54

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/components/NotificationRow.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { shell } = require('electron');
1+
import { openExternalLink } from '../utils/comms';
22

33
import React, { useCallback, useContext } from 'react';
44
import { formatDistanceToNow, parseISO } from 'date-fns';
@@ -18,8 +18,12 @@ export const NotificationRow: React.FC<IProps> = ({
1818
notification,
1919
hostname,
2020
}) => {
21-
const { settings, accounts } = useContext(AppContext);
22-
const { markNotification, unsubscribeNotification } = useContext(AppContext);
21+
const {
22+
settings,
23+
accounts,
24+
markNotification,
25+
unsubscribeNotification,
26+
} = useContext(AppContext);
2327

2428
const pressTitle = useCallback(() => {
2529
openBrowser();
@@ -37,10 +41,10 @@ export const NotificationRow: React.FC<IProps> = ({
3741
notification.id,
3842
accounts.user?.id
3943
);
40-
shell.openExternal(url);
44+
openExternalLink(url);
4145
} else if (notification.subject.type === 'Discussion') {
4246
getDiscussionUrl(notification, accounts.token).then(url =>
43-
shell.openExternal(
47+
openExternalLink(
4448
generateGitHubWebUrl(
4549
url || `${notification.repository.url}/discussions`,
4650
notification.id,

src/utils/notifications.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { remote, shell } = require('electron');
1+
const { remote } = require('electron');
22

33
import { generateGitHubWebUrl, getDiscussionUrl } from './helpers';
44
import { reOpenWindow, openExternalLink, updateTrayIcon } from './comms';
@@ -93,9 +93,9 @@ export const raiseNativeNotification = (
9393
if (notificationUrl) {
9494
const url = generateGitHubWebUrl(subject.url, id, accounts.user?.id);
9595
openExternalLink(url);
96-
} else if (notifications[0].subject.type === 'Discussion') {
96+
} else if (subject.type === 'Discussion') {
9797
getDiscussionUrl(notifications[0], accounts.token).then(url =>
98-
shell.openExternal(
98+
openExternalLink(
9999
generateGitHubWebUrl(
100100
url || `${repository.url}/discussions`,
101101
id,

0 commit comments

Comments
 (0)