File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 1
- const { shell } = require ( 'electron' ) ;
1
+ import { openExternalLink } from '../utils/comms' ;
2
2
3
3
import React , { useCallback , useContext } from 'react' ;
4
4
import { formatDistanceToNow , parseISO } from 'date-fns' ;
@@ -18,8 +18,12 @@ export const NotificationRow: React.FC<IProps> = ({
18
18
notification,
19
19
hostname,
20
20
} ) => {
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 ) ;
23
27
24
28
const pressTitle = useCallback ( ( ) => {
25
29
openBrowser ( ) ;
@@ -37,10 +41,10 @@ export const NotificationRow: React.FC<IProps> = ({
37
41
notification . id ,
38
42
accounts . user ?. id
39
43
) ;
40
- shell . openExternal ( url ) ;
44
+ openExternalLink ( url ) ;
41
45
} else if ( notification . subject . type === 'Discussion' ) {
42
46
getDiscussionUrl ( notification , accounts . token ) . then ( url =>
43
- shell . openExternal (
47
+ openExternalLink (
44
48
generateGitHubWebUrl (
45
49
url || `${ notification . repository . url } /discussions` ,
46
50
notification . id ,
Original file line number Diff line number Diff line change 1
- const { remote, shell } = require ( 'electron' ) ;
1
+ const { remote } = require ( 'electron' ) ;
2
2
3
3
import { generateGitHubWebUrl , getDiscussionUrl } from './helpers' ;
4
4
import { reOpenWindow , openExternalLink , updateTrayIcon } from './comms' ;
@@ -93,9 +93,9 @@ export const raiseNativeNotification = (
93
93
if ( notificationUrl ) {
94
94
const url = generateGitHubWebUrl ( subject . url , id , accounts . user ?. id ) ;
95
95
openExternalLink ( url ) ;
96
- } else if ( notifications [ 0 ] . subject . type === 'Discussion' ) {
96
+ } else if ( subject . type === 'Discussion' ) {
97
97
getDiscussionUrl ( notifications [ 0 ] , accounts . token ) . then ( url =>
98
- shell . openExternal (
98
+ openExternalLink (
99
99
generateGitHubWebUrl (
100
100
url || `${ repository . url } /discussions` ,
101
101
id ,
You can’t perform that action at this time.
0 commit comments