Skip to content

Commit b976713

Browse files
committed
move to shared constant
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent f89974f commit b976713

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/menu.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export default class MenuBuilder {
7878
{
7979
label: 'Visit Repository',
8080
click: () => {
81-
shell.openExternal(`https://github.com/${APPLICATION.REPO_SLUG}`);
81+
shell.openExternal(
82+
`${APPLICATION.GITHUB_BASE_URL}/${APPLICATION.REPO_SLUG}`,
83+
);
8284
},
8385
},
8486
{

src/renderer/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const Constants = {
1616
clientSecret: process.env.OAUTH_CLIENT_SECRET as ClientSecret,
1717
} satisfies LoginOAuthAppOptions,
1818

19-
GITHUB_BASE_URL: 'https://github.com',
2019
GITHUB_API_BASE_URL: 'https://api.github.com',
2120
GITHUB_API_GRAPHQL_URL: 'https://api.github.com/graphql',
2221

src/renderer/utils/api/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { AxiosResponse } from 'axios';
22

3+
import { APPLICATION } from '../../../shared/constants';
4+
35
import { Constants } from '../../constants';
46

57
import type { Hostname } from '../../types';
@@ -17,7 +19,7 @@ export function getGitHubAPIBaseUrl(hostname: Hostname): URL {
1719
}
1820

1921
export function getGitHubAuthBaseUrl(hostname: Hostname): URL {
20-
const url = new URL(Constants.GITHUB_BASE_URL);
22+
const url = new URL(APPLICATION.GITHUB_BASE_URL);
2123

2224
if (isEnterpriseServerHost(hostname)) {
2325
url.hostname = hostname;

src/renderer/utils/links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { generateGitHubWebUrl } from './helpers';
1717

1818
export function openGitifyReleaseNotes(version: string) {
1919
openExternalLink(
20-
`https://github.com/${APPLICATION.REPO_SLUG}/releases/tag/${version}` as Link,
20+
`${APPLICATION.GITHUB_BASE_URL}/${APPLICATION.REPO_SLUG}/releases/tag/${version}` as Link,
2121
);
2222
}
2323

src/shared/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export const APPLICATION = {
99

1010
WEBSITE: 'https://gitify.io',
1111

12+
GITHUB_BASE_URL: 'https://github.com',
13+
1214
REPO_SLUG: 'gitify-app/gitify',
1315

1416
DEFAULT_KEYBOARD_SHORTCUT: 'CommandOrControl+Shift+G',

0 commit comments

Comments
 (0)