Skip to content

Commit 9c874ec

Browse files
committed
refactor: octokit openapi types
Signed-off-by: Adam Setch <[email protected]>
1 parent 7b12886 commit 9c874ec

File tree

10 files changed

+122
-440
lines changed

10 files changed

+122
-440
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
"@biomejs/biome": "1.9.4",
140140
"@discordapp/twemoji": "15.1.0",
141141
"@electron/notarize": "2.5.0",
142+
"@octokit/openapi-types": "22.2.0",
142143
"@primer/octicons-react": "19.12.0",
143144
"@testing-library/react": "16.0.1",
144145
"@types/jest": "29.5.14",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/RepositoryNotifications.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { CheckIcon, MarkGithubIcon, ReadIcon } from '@primer/octicons-react';
22
import { type FC, type MouseEvent, useContext, useState } from 'react';
33
import { AppContext } from '../context/App';
4-
import { Opacity, Size } from '../types';
4+
import { type Link, Opacity, Size } from '../types';
55
import type { Notification } from '../typesGitHub';
66
import { cn } from '../utils/cn';
7+
import { openExternalLink } from '../utils/comms';
78
import {
89
getChevronDetails,
910
isMarkAsDoneFeatureSupported,
1011
} from '../utils/helpers';
11-
import { openRepository } from '../utils/links';
1212
import { HoverGroup } from './HoverGroup';
1313
import { NotificationRow } from './NotificationRow';
1414
import { InteractionButton } from './buttons/InteractionButton';
@@ -67,7 +67,9 @@ export const RepositoryNotifications: FC<IRepositoryNotifications> = ({
6767
onClick={(event: MouseEvent<HTMLElement>) => {
6868
// Don't trigger onClick of parent element.
6969
event.stopPropagation();
70-
openRepository(repoNotifications[0].repository);
70+
openExternalLink(
71+
repoNotifications[0].repository.html_url as Link,
72+
);
7173
}}
7274
>
7375
{repoName}

src/renderer/components/notification/NotificationHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { MarkGithubIcon } from '@primer/octicons-react';
22
import { type FC, type MouseEvent, useContext } from 'react';
33
import { AppContext } from '../../context/App';
4-
import { Opacity, Size } from '../../types';
4+
import { type Link, Opacity, Size } from '../../types';
55
import type { Notification } from '../../typesGitHub';
66
import { cn } from '../../utils/cn';
7-
import { openRepository } from '../../utils/links';
7+
import { openExternalLink } from '../../utils/comms';
88
import { AvatarIcon } from '../icons/AvatarIcon';
99

1010
interface INotificationHeader {
@@ -43,7 +43,7 @@ export const NotificationHeader: FC<INotificationHeader> = ({
4343
onClick={(event: MouseEvent<HTMLElement>) => {
4444
// Don't trigger onClick of parent element.
4545
event.stopPropagation();
46-
openRepository(notification.repository);
46+
openExternalLink(notification.repository.html_url as Link);
4747
}}
4848
>
4949
{repoSlug}

0 commit comments

Comments
 (0)