File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,19 @@ export default async (ctx) => {
19
19
} ) ;
20
20
const notifications = response . data ;
21
21
22
- const items = notifications . map ( ( item ) => ( {
23
- title : item . subject . title ,
24
- description : item . subject . title ,
25
- pubDate : parseDate ( item . updated_at ) , // item.updated_at follows ISO 8601.
26
- guid : item . id ,
27
- link : item . subject . url ,
28
- } ) ) ;
22
+ const items = notifications . map ( ( item ) => {
23
+ let originUrl = item . subject . url ? item . subject . url . replace ( 'https://api.github.com/repos/' , 'https://github.com/' ) : 'https://github.com/notifications' ;
24
+ if ( originUrl . includes ( '/releases/' ) ) {
25
+ originUrl = originUrl . replace ( / \/ r e l e a s e s \/ \d + $ / , '/releases' ) ;
26
+ }
27
+ return {
28
+ title : item . subject . title ,
29
+ description : item . subject . title ,
30
+ pubDate : parseDate ( item . updated_at ) , // item.updated_at follows ISO 8601.
31
+ guid : item . id ,
32
+ link : originUrl ,
33
+ } ;
34
+ } ) ;
29
35
30
36
ctx . set ( 'data' , {
31
37
title : 'Github Notifications' ,
You can’t perform that action at this time.
0 commit comments