@ -970,10 +970,7 @@ export default class AccountViewView extends Vue {
/ / C h e c k l i m i t s f o r a n y u s e r w i t h a n a c t i v e D i d ( t h i s w i l l a l s o c h e c k r e g i s t r a t i o n s t a t u s )
if ( this . activeDid ) {
console . log ( '[DEBUG] Calling checkLimits from mounted for user with activeDid' ) ;
await this . checkLimits ( ) ;
} else {
console . log ( '[DEBUG] Not calling checkLimits - no activeDid available' ) ;
}
/ / O n l y c h e c k s e r v i c e w o r k e r o n w e b p l a t f o r m - C a p a c i t o r / E l e c t r o n d o n ' t s u p p o r t i t
@ -1014,20 +1011,13 @@ export default class AccountViewView extends Vue {
* Initializes component state with values from the database or defaults .
* /
async initializeState ( ) : Promise < void > {
console . log ( '[DEBUG] AccountViewView - initializeState called' ) ;
/ / F i r s t g e t t h e m a s t e r s e t t i n g s t o s e e t h e a c t i v e D I D
const masterSettings = await this . $settings ( ) ;
console . log ( '[DEBUG] AccountViewView - Master settings activeDid:' , masterSettings . activeDid ) ;
/ / T h e n g e t t h e a c c o u n t - s p e c i f i c s e t t i n g s
const settings : AccountSettings = await this . $accountSettings ( ) ;
console . log ( '[DEBUG] AccountViewView - Account settings loaded for DID:' , settings . activeDid ) ;
console . log ( '[DEBUG] AccountViewView - Account settings isRegistered:' , settings ? . isRegistered ) ;
this . activeDid = settings . activeDid || "" ;
console . log ( '[DEBUG] initializeState - activeDid:' , this . activeDid ) ;
console . log ( '[DEBUG] initializeState - settings.isRegistered:' , settings ? . isRegistered ) ;
this . apiServer = settings . apiServer || "" ;
this . apiServerInput = settings . apiServer || "" ;
this . givenName =
@ -1056,9 +1046,6 @@ export default class AccountViewView extends Vue {
this . warnIfTestServer = ! ! settings . warnIfTestServer ;
this . webPushServer = settings . webPushServer || this . webPushServer ;
this . webPushServerInput = settings . webPushServer || this . webPushServerInput ;
console . log ( '[DEBUG] initializeState complete - isRegistered:' , this . isRegistered ) ;
console . log ( '[DEBUG] initializeState complete - activeDid:' , this . activeDid ) ;
}
/ / c a l l f n , c o p y t e x t t o t h e c l i p b o a r d , t h e n r e d o f n a f t e r 2 s e c o n d s
@ -1401,17 +1388,11 @@ export default class AccountViewView extends Vue {
}
async checkLimits ( ) : Promise < void > {
console . log ( '[DEBUG] checkLimits called' ) ;
console . log ( '[DEBUG] activeDid:' , this . activeDid ) ;
console . log ( '[DEBUG] isRegistered:' , this . isRegistered ) ;
this . loadingLimits = true ;
try {
const did = this . activeDid ;
console . log ( '[DEBUG] did value:' , did ) ;
if ( ! did ) {
console . log ( '[DEBUG] No DID found, setting NO_IDENTIFIER message' ) ;
this . limitsMessage = ACCOUNT_VIEW_CONSTANTS . LIMITS . NO_IDENTIFIER ;
return ;
}
@ -1422,16 +1403,11 @@ export default class AccountViewView extends Vue {
webPushServer : this . webPushServer ,
} ) ;
console . log ( '[DEBUG] Calling fetchImageRateLimits for DID:' , did ) ;
const imageResp = await fetchImageRateLimits ( this . axios , did ) ;
console . log ( '[DEBUG] Image rate limits response status:' , imageResp . status ) ;
console . log ( '[DEBUG] Image rate limits response data:' , imageResp . data ) ;
if ( imageResp . status === 200 ) {
this . imageLimits = imageResp . data ;
console . log ( '[DEBUG] Image limits set successfully' ) ;
} else {
console . log ( '[DEBUG] Image rate limits failed, status:' , imageResp . status ) ;
await this . $saveSettings ( {
profileImageUrl : "" ,
} ) ;
@ -1441,21 +1417,15 @@ export default class AccountViewView extends Vue {
return ;
}
console . log ( '[DEBUG] Calling fetchEndorserRateLimits for DID:' , did ) ;
console . log ( '[DEBUG] API server:' , this . apiServer ) ;
const endorserResp = await fetchEndorserRateLimits (
this . apiServer ,
this . axios ,
did ,
) ;
console . log ( '[DEBUG] Endorser rate limits response status:' , endorserResp . status ) ;
console . log ( '[DEBUG] Endorser rate limits response data:' , endorserResp . data ) ;
if ( endorserResp . status === 200 ) {
this . endorserLimits = endorserResp . data ;
console . log ( '[DEBUG] Endorser limits set successfully' ) ;
} else {
console . log ( '[DEBUG] Endorser rate limits failed, status:' , endorserResp . status ) ;
await this . $saveSettings ( {
profileImageUrl : "" ,
} ) ;
@ -1465,14 +1435,11 @@ export default class AccountViewView extends Vue {
return ;
}
} catch ( error ) {
console . log ( '[DEBUG] Error in checkLimits:' , error ) ;
this . limitsMessage =
ACCOUNT_VIEW_CONSTANTS . LIMITS . ERROR_RETRIEVING_LIMITS ;
this . notify . error ( this . limitsMessage , TIMEOUTS . STANDARD ) ;
} finally {
console . log ( '[DEBUG] Setting loadingLimits to false' ) ;
this . loadingLimits = false ;
console . log ( '[DEBUG] Final limitsMessage:' , this . limitsMessage ) ;
}
}
@ -1725,8 +1692,6 @@ export default class AccountViewView extends Vue {
}
onRecheckLimits ( ) {
console . log ( '[DEBUG] onRecheckLimits called - button clicked' ) ;
console . log ( '[DEBUG] Current state - loadingLimits:' , this . loadingLimits , 'limitsMessage:' , this . limitsMessage ) ;
this . checkLimits ( ) ;
}
}