File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ export type OctokitClient = InstanceType<typeof OctokitWithPlugins>;
1818// Cache Octokit clients per account UUID + type (rest|graphql)
1919const 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 *
You can’t perform that action at this time.
0 commit comments