Skip to content

Commit 53d30e3

Browse files
committed
fix lint
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent cf5c17b commit 53d30e3

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

src/renderer/utils/api/octokit.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export type OctokitClient = InstanceType<typeof OctokitWithPlugins>;
1818
// Cache Octokit clients per account UUID + type (rest|graphql)
1919
const octokitClientCache = new Map<string, OctokitClient>();
2020

21-
const version = getAppVersion();
22-
2321
/**
2422
* Clear the Octokit client cache
2523
* Useful when accounts are added/removed or tokens change
@@ -68,27 +66,20 @@ export async function createOctokitClientUncached(
6866
): Promise<OctokitClient> {
6967
const decryptedToken = await decryptValue(account.token);
7068

69+
const version = await getAppVersion();
70+
const userAgent = `${APPLICATION.NAME}/${version}`;
71+
7172
const baseUrl = getGitHubAPIBaseUrl(account.hostname, type)
7273
.toString()
7374
.replace(/\/$/, '');
74-
const userAgent = getUserAgent();
7575

7676
return new OctokitWithPlugins({
7777
auth: decryptedToken,
78-
baseUrl,
78+
baseUrl: baseUrl,
7979
userAgent: userAgent,
8080
});
8181
}
8282

83-
/**
84-
* Format Gitify User Agent
85-
*
86-
* @returns User Agent to be set for API requests
87-
*/
88-
export function getUserAgent() {
89-
return `${APPLICATION.NAME}/${version}`;
90-
}
91-
9283
/**
9384
* Calculate client cache key for account and api type
9485
*

0 commit comments

Comments
 (0)