@@ -10,6 +10,7 @@ import { OctokitResponse, RequestParameters, ResponseHeaders } from '@octokit/ty
10
10
import PQueue from 'p-queue' ;
11
11
import * as vscode from 'vscode' ;
12
12
import Logger from '../common/logger' ;
13
+ import { DEFAULT_GRAVATAR_STYLE , PR_SETTINGS_NAMESPACE } from '../common/settingKeys' ;
13
14
import * as Common from '../common/timelineEvent' ;
14
15
import { IAccount , Issue , ITeam , PullRequest } from './interface' ;
15
16
import { LoggingOctokit } from './loggingOctokit' ;
@@ -23,8 +24,8 @@ function isGravatarEnabled() {
23
24
24
25
function getGravatarStyle ( ) {
25
26
return vscode . workspace
26
- . getConfiguration ( 'githubPullRequests' )
27
- . get < string > ( 'defaultGravatarsStyle' , GRAVATAR_STYLE_NONE ) ;
27
+ . getConfiguration ( PR_SETTINGS_NAMESPACE )
28
+ . get < string > ( DEFAULT_GRAVATAR_STYLE , GRAVATAR_STYLE_NONE ) ;
28
29
}
29
30
30
31
function generateGravatarUrl ( gravatarId : string | undefined , size : number = 200 ) : string | undefined {
@@ -168,7 +169,7 @@ export class Avatars {
168
169
const serverDate = headers . date ? new Date ( headers . date ) : new Date ( ) ;
169
170
const expireAt = serverDate . setSeconds (
170
171
serverDate . getSeconds ( ) +
171
- ( cacheControlDirectives [ 's-maxage' ] ?? cacheControlDirectives [ 'max-age' ] ?? 0 ) ,
172
+ ( cacheControlDirectives [ 's-maxage' ] ?? cacheControlDirectives [ 'max-age' ] ?? 0 ) ,
172
173
) ;
173
174
if ( expireAt - Date . now ( ) > 0 ) {
174
175
Logger . appendLine ( 'Cache fresh hit' , LOGGER_COMPONENT ) ;
@@ -249,7 +250,7 @@ export class Avatars {
249
250
await vscode . workspace . fs . writeFile ( cacheResult . uri , cacheResult . content ) ;
250
251
return convertBinaryToDataUri ( cacheResult . content , cacheResult . contentType ) ;
251
252
} ,
252
- ( reason : RequestError ) => {
253
+ ( reason : RequestError ) => {
253
254
if ( reason . status !== 304 ) {
254
255
Logger . warn ( `REST request failed: ${ reason . message } ` , LOGGER_COMPONENT ) ;
255
256
return ;
0 commit comments