Skip to content

Commit 637bba6

Browse files
committed
Merge branch 'main' into refactor/handlers-consistent-notification
Signed-off-by: Adam Setch <[email protected]>
2 parents 0263f5e + 826cf20 commit 637bba6

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/renderer/utils/notifications/handlers/discussion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class DiscussionHandler extends DefaultHandler {
9494
}
9595

9696
defaultUrl(notification: GitifyNotification): Link {
97-
const url = new URL(notification.repository.htmlUrl);
97+
const url = new URL(defaultHandler.defaultUrl(notification));
9898
url.pathname += '/discussions';
9999
return url.href as Link;
100100
}

src/renderer/utils/notifications/handlers/issue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class IssueHandler extends DefaultHandler {
8585
}
8686

8787
defaultUrl(notification: GitifyNotification): Link {
88-
const url = new URL(notification.repository.htmlUrl);
88+
const url = new URL(defaultHandler.defaultUrl(notification));
8989
url.pathname += '/issues';
9090
return url.href as Link;
9191
}

src/renderer/utils/notifications/handlers/pullRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class PullRequestHandler extends DefaultHandler {
9999
}
100100

101101
defaultUrl(notification: GitifyNotification): Link {
102-
const url = new URL(notification.repository.htmlUrl);
102+
const url = new URL(defaultHandler.defaultUrl(notification));
103103
url.pathname += '/pulls';
104104
return url.href as Link;
105105
}

src/renderer/utils/notifications/handlers/release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
} from '../../../types';
1414
import { getRelease } from '../../api/client';
1515
import { isStateFilteredOut } from '../filters/filter';
16-
import { DefaultHandler } from './default';
16+
import { DefaultHandler, defaultHandler } from './default';
1717
import { getNotificationAuthor } from './utils';
1818

1919
class ReleaseHandler extends DefaultHandler {
@@ -54,7 +54,7 @@ class ReleaseHandler extends DefaultHandler {
5454
}
5555

5656
defaultUrl(notification: GitifyNotification): Link {
57-
const url = new URL(notification.repository.htmlUrl);
57+
const url = new URL(defaultHandler.defaultUrl(notification));
5858
url.pathname += '/releases';
5959
return url.href as Link;
6060
}

src/renderer/utils/notifications/handlers/repositoryDependabotAlertsThread.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { OcticonProps } from '@primer/octicons-react';
44
import { AlertIcon } from '@primer/octicons-react';
55

66
import type { GitifyNotification, Link } from '../../../types';
7-
import { DefaultHandler } from './default';
7+
import { DefaultHandler, defaultHandler } from './default';
88

99
class RepositoryDependabotAlertsThreadHandler extends DefaultHandler {
1010
readonly type = 'RepositoryDependabotAlertsThread';
@@ -14,7 +14,7 @@ class RepositoryDependabotAlertsThreadHandler extends DefaultHandler {
1414
}
1515

1616
defaultUrl(notification: GitifyNotification): Link {
17-
const url = new URL(notification.repository.htmlUrl);
17+
const url = new URL(defaultHandler.defaultUrl(notification));
1818
url.pathname += '/security/dependabot';
1919
return url.href as Link;
2020
}

src/renderer/utils/notifications/handlers/repositoryInvitation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { FC } from 'react';
33
import { MailIcon, type OcticonProps } from '@primer/octicons-react';
44

55
import type { GitifyNotification, Link } from '../../../types';
6-
import { DefaultHandler } from './default';
6+
import { DefaultHandler, defaultHandler } from './default';
77

88
class RepositoryInvitationHandler extends DefaultHandler {
99
readonly type = 'RepositoryInvitation';
@@ -13,7 +13,7 @@ class RepositoryInvitationHandler extends DefaultHandler {
1313
}
1414

1515
defaultUrl(notification: GitifyNotification): Link {
16-
const url = new URL(notification.repository.htmlUrl);
16+
const url = new URL(defaultHandler.defaultUrl(notification));
1717
url.pathname += '/invitations';
1818
return url.href as Link;
1919
}

0 commit comments

Comments
 (0)