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 {
3838 if ( ! this . isAuthenticated ( ) ) {
3939 throw new Error ( "Authentication required to fetch user status" ) ;
4040 }
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+ } ) ;
4250 }
4351
4452 async fetchUserAllSubmissions ( options : {
Original file line number Diff line number Diff line change @@ -32,7 +32,14 @@ export class LeetCodeGlobalService implements LeetCodeBaseService {
3232 if ( ! this . isAuthenticated ( ) ) {
3333 throw new Error ( "Authentication required to fetch user status" ) ;
3434 }
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+ } ) ;
3643 }
3744
3845 async fetchUserAllSubmissions ( options : {
You can’t perform that action at this time.
0 commit comments