@ -309,7 +309,6 @@ import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { createNotifyHelpers , TIMEOUTS } from "@/utils/notify" ;
import {
NOTIFY_CONTACT_LOADING_ISSUE ,
NOTIFY_FEED_LOADING_ISSUE ,
NOTIFY_CONFIRMATION_ERROR ,
} from "@/constants/notifications" ;
import * as Package from "../../package.json" ;
@ -485,6 +484,10 @@ export default class HomeView extends Vue {
if ( newDid !== oldDid ) {
/ / R e - i n i t i a l i z e i d e n t i t y w i t h n e w s e t t i n g s ( l o a d s s e t t i n g s i n t e r n a l l y )
await this . initializeIdentity ( ) ;
} else {
logger . info (
"[HomeView Settings Trace] 📍 DID unchanged, skipping re-initialization" ,
) ;
}
}
@ -527,11 +530,7 @@ export default class HomeView extends Vue {
/ / L o a d s e t t i n g s w i t h b e t t e r e r r o r c o n t e x t u s i n g u l t r a - c o n c i s e m i x i n
let settings ;
try {
settings = await this . $settings ( {
apiServer : "" ,
activeDid : "" ,
isRegistered : false ,
} ) ;
settings = await this . $accountSettings ( ) ;
} catch ( error ) {
this . $logAndConsole (
` [HomeView] Failed to retrieve settings: ${ error } ` ,
@ -599,65 +598,21 @@ export default class HomeView extends Vue {
/ / U l t r a - c o n c i s e s e t t i n g s u p d a t e w i t h a u t o m a t i c c a c h e i n v a l i d a t i o n !
await this . $saveMySettings ( { isRegistered : true } ) ;
this . isRegistered = true ;
/ / F o r c e V u e t o r e - r e n d e r t h e t e m p l a t e
await this . $nextTick ( ) ;
}
} catch ( error ) {
/ / C o n s o l i d a t e l o g g i n g : O n l y l o g u n e x p e c t e d e r r o r s , n o t e x p e c t e d 4 0 0 s
const axiosError = error as any ;
if ( axiosError ? . response ? . status !== 400 ) {
this . $logAndConsole (
` [HomeView] Registration check failed: ${ error } ` ,
true ,
) ;
}
/ / C o n t i n u e a s u n r e g i s t e r e d - t h i s i s e x p e c t e d f o r n e w u s e r s
}
}
/ / I n i t i a l i z e f e e d a n d o f f e r s
try {
/ / S t a r t f e e d u p d a t e i n b a c k g r o u n d
this . updateAllFeed ( ) . catch ( ( error ) => {
this . $logAndConsole (
` [HomeView] Background feed update failed: ${ error } ` ,
true ,
logger . warn (
"[HomeView Settings Trace] ⚠️ Registration check failed" ,
{
error : error instanceof Error ? error . message : String ( error ) ,
} ,
) ;
} ) ;
/ / L o a d n e w o f f e r s i f w e h a v e a n a c t i v e D I D
if ( this . activeDid ) {
const [ offersToUser , offersToProjects ] = await Promise . all ( [
getNewOffersToUser (
this . axios ,
this . apiServer ,
this . activeDid ,
this . lastAckedOfferToUserJwtId ,
) ,
getNewOffersToUserProjects (
this . axios ,
this . apiServer ,
this . activeDid ,
this . lastAckedOfferToUserProjectsJwtId ,
) ,
] ) ;
this . numNewOffersToUser = offersToUser . data . length ;
this . newOffersToUserHitLimit = offersToUser . hitLimit ;
this . numNewOffersToUserProjects = offersToProjects . data . length ;
this . newOffersToUserProjectsHitLimit = offersToProjects . hitLimit ;
}
} catch ( error ) {
this . $logAndConsole (
` [HomeView] Failed to initialize feed/offers: ${ error } ` ,
true ,
) ;
/ / D o n ' t t h r o w - w e c a n c o n t i n u e w i t h e m p t y f e e d
this . notify . warning ( NOTIFY_FEED_LOADING_ISSUE . message , TIMEOUTS . LONG ) ;
}
} catch ( error ) {
this . handleError ( error ) ;
throw error ; / / R e - t h r o w t o b e c a u g h t b y m o u n t e d ( )
} catch ( err : unknown ) {
logger . error ( "[HomeView Settings Trace] ❌ initializeIdentity() failed" , {
error : err instanceof Error ? err . message : String ( err ) ,
} ) ;
throw err ;
}
}
@ -682,10 +637,8 @@ export default class HomeView extends Vue {
}
/ * *
* Loads user settings from storage using ultra - concise mixin utilities
* Sets component state for :
* - API server , Active DID , Feed filters and view settings
* - Registration status , Notification acknowledgments
* Loads user settings from database using ultra - concise mixin
* Used for displaying settings in feed and actions
*
* @ internal
* Called by mounted ( ) and reloadFeedOnChange ( )
@ -815,7 +768,7 @@ export default class HomeView extends Vue {
* Called by mounted ( )
* /
private async checkOnboarding ( ) {
const settings = await this . $s ettings ( ) ;
const settings = await this . $accountS ettings ( ) ;
if ( ! settings . finishedOnboarding ) {
( this . $refs . onboardingDialog as OnboardingDialog ) . open ( OnboardPage . Home ) ;
}