File tree Expand file tree Collapse file tree 4 files changed +9
-12
lines changed
apps/desktop/packages/mainWindow/src/pages/Settings Expand file tree Collapse file tree 4 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -226,11 +226,11 @@ const Accounts = () => {
226226 ? globalStore . gdlAccount . data ?. value
227227 : undefined
228228
229- const userId = createMemo ( ( ) => validGDLUser ( ) ?. id )
229+ const friendCode = createMemo ( ( ) => validGDLUser ( ) ?. friendCode )
230230
231231 const nicknameHistoryQuery = rspc . createQuery ( ( ) => ( {
232- queryKey : [ "account.getNicknameHistory" , userId ( ) ?? 0 ] ,
233- enabled : ! ! userId ( )
232+ queryKey : [ "account.getNicknameHistory" , friendCode ( ) ?? "" ] ,
233+ enabled : ! ! friendCode ( )
234234 } ) )
235235
236236 const invalidGDLUser = ( ) => globalStore . gdlAccount . data ?. status === "invalid"
Original file line number Diff line number Diff line change @@ -165,9 +165,9 @@ pub(super) fn mount() -> RouterBuilder<App> {
165165 . await
166166 }
167167
168- query GET_NICKNAME_HISTORY [ app, user_id : i32 ] {
168+ query GET_NICKNAME_HISTORY [ app, friend_code : String ] {
169169 let history = app. account_manager( )
170- . get_nickname_history( user_id )
170+ . get_nickname_history( friend_code )
171171 . await ?;
172172
173173 Ok ( history. into_iter( ) . map( FENicknameHistoryEntry :: from) . collect:: <Vec <_>>( ) )
@@ -488,7 +488,6 @@ impl From<GDLAccountStatus> for FEGDLAccountStatus {
488488#[ derive( Type , Debug , Serialize , Deserialize ) ]
489489#[ serde( rename_all = "camelCase" ) ]
490490struct FEGDLAccount {
491- id : i32 ,
492491 email : String ,
493492 microsoft_oid : String ,
494493 nickname : String ,
@@ -508,7 +507,6 @@ struct FEGDLAccount {
508507impl From < GDLUser > for FEGDLAccount {
509508 fn from ( value : GDLUser ) -> Self {
510509 Self {
511- id : value. id ,
512510 email : value. email ,
513511 microsoft_oid : value. microsoft_oid ,
514512 nickname : value. nickname ,
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ pub enum GDLAccountStatus {
7676
7777#[ derive( Clone , Serialize , Deserialize ) ]
7878pub struct GDLUser {
79- pub id : i32 ,
8079 pub email : String ,
8180 pub microsoft_oid : String ,
8281 pub nickname : String ,
@@ -361,11 +360,11 @@ impl GDLAccountTask {
361360
362361 pub async fn get_nickname_history (
363362 & self ,
364- user_id : i32 ,
363+ friend_code : String ,
365364 ) -> anyhow:: Result < Vec < NicknameHistoryEntry > > {
366365 let url = format ! (
367366 "{}/v1/users/users/{}/nickname-history" ,
368- self . base_api, user_id
367+ self . base_api, friend_code
369368 ) ;
370369
371370 let resp = self . client . get ( url) . send ( ) . await ?;
Original file line number Diff line number Diff line change @@ -529,9 +529,9 @@ impl<'s> ManagerRef<'s, AccountManager> {
529529
530530 pub async fn get_nickname_history (
531531 self ,
532- user_id : i32 ,
532+ friend_code : String ,
533533 ) -> anyhow:: Result < Vec < NicknameHistoryEntry > > {
534- self . gdl_account_task . get_nickname_history ( user_id ) . await
534+ self . gdl_account_task . get_nickname_history ( friend_code ) . await
535535 }
536536
537537 pub async fn clear_nickname_history ( self , uuid : String ) -> anyhow:: Result < ( ) > {
You can’t perform that action at this time.
0 commit comments