File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,15 @@ export class LeetCodeCNService implements LeetCodeBaseService {
38
38
if ( ! this . isAuthenticated ( ) ) {
39
39
throw new Error ( "Authentication required to fetch user status" ) ;
40
40
}
41
- return await this . leetCodeApi . userStatus ( ) ;
41
+ return await this . leetCodeApi . userStatus ( ) . then ( ( res ) => {
42
+ return {
43
+ isSignedIn : res ?. isSignedIn ?? false ,
44
+ username : res ?. username ?? "" ,
45
+ avatar : res ?. avatar ?? "" ,
46
+ isAdmin : res ?. isAdmin ?? false ,
47
+ useTranslation : res ?. useTranslation ?? false
48
+ } ;
49
+ } ) ;
42
50
}
43
51
44
52
async fetchUserAllSubmissions ( options : {
Original file line number Diff line number Diff line change @@ -32,7 +32,14 @@ export class LeetCodeGlobalService implements LeetCodeBaseService {
32
32
if ( ! this . isAuthenticated ( ) ) {
33
33
throw new Error ( "Authentication required to fetch user status" ) ;
34
34
}
35
- return await this . leetCodeApi . whoami ( ) ;
35
+ return await this . leetCodeApi . whoami ( ) . then ( ( res ) => {
36
+ return {
37
+ isSignedIn : res ?. isSignedIn ?? false ,
38
+ username : res ?. username ?? "" ,
39
+ avatar : res ?. avatar ?? "" ,
40
+ isAdmin : res ?. isAdmin ?? false
41
+ } ;
42
+ } ) ;
36
43
}
37
44
38
45
async fetchUserAllSubmissions ( options : {
You can’t perform that action at this time.
0 commit comments