@ -43,7 +43,26 @@
< h2 class = "text-xl font-medium" > { { meeting . name } } < / h2 >
< / div >
< p v-if ="meetings.length === 0" class="text-center text-gray-500 py-8" >
<!-- Create Meeting Button for registered users with no meetings -- >
< div
v - if = "meetings.length === 0 && isRegistered"
class = "text-center py-8"
>
< p class = "text-gray-500 mb-4" > No onboarding meetings available < / p >
< button
class = "bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-6 py-3 rounded-md hover:from-green-500 hover:to-green-800 transition-colors"
@ click = "createMeeting"
>
< font -awesome icon = "plus" class = "mr-2" / >
Create Meeting
< / button >
< / div >
<!-- No meetings message for unregistered users -- >
< p
v - if = "meetings.length === 0 && !isRegistered"
class = "text-center text-gray-500 py-8"
>
No onboarding meetings available
< / p >
< / div >
@ -89,14 +108,13 @@ import { Router } from "vue-router";
import QuickNav from "../components/QuickNav.vue" ;
import TopMessage from "../components/TopMessage.vue" ;
import * as databaseUtil from "../db/databaseUtil" ;
import { logConsoleAndDb } from "../db/databaseUtil" ;
import { encryptMessage } from "../libs/crypto" ;
import {
errorStringForLog ,
getHeaders ,
serverMessageForUser ,
} from "../libs/endorserServer" ;
import { encryptMessage } from "../libs/crypto ";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin ";
interface Meeting {
name : string ;
@ -108,6 +126,7 @@ interface Meeting {
QuickNav ,
TopMessage ,
} ,
mixins : [ PlatformServiceMixin ] ,
} )
export default class OnboardMeetingListView extends Vue {
$notify ! : (
@ -135,57 +154,132 @@ export default class OnboardMeetingListView extends Vue {
showPasswordDialog = false ;
async created ( ) {
const settings = await databaseUtil . retrieveSettingsForActiveAccount ( ) ;
this . activeDid = settings . activeDid || "" ;
this . apiServer = settings . apiServer || "" ;
this . firstName = settings . firstName || "" ;
this . isRegistered = ! ! settings . isRegistered ;
await this . fetchMeetings ( ) ;
console . log ( "📋 DEBUG: OnboardMeetingListView created() called" ) ;
const settings = await this . $accountSettings ( ) ;
console . log ( "📋 DEBUG: Settings loaded:" , settings ) ;
/ / 🔍 T E M P O R A R Y D E B U G : C h e c k r a w d a t a b a s e f o r t e s t u s e r r e g i s t r a t i o n s t a t e
if ( settings ? . activeDid ) {
console . log (
"📋 DEBUG: Checking raw database settings for DID:" ,
settings . activeDid ,
) ;
try {
/ / C h e c k m a s t e r s e t t i n g s
const masterSettings = await this . $query (
"SELECT * FROM settings WHERE id = ?" ,
[ 1 ] ,
) ;
console . log ( "📋 DEBUG: Master settings:" , masterSettings ) ;
/ / C h e c k a c c o u n t - s p e c i f i c s e t t i n g s
const accountSettings = await this . $query (
"SELECT * FROM settings WHERE accountDid = ?" ,
[ settings . activeDid ] ,
) ;
console . log ( "📋 DEBUG: Account-specific settings:" , accountSettings ) ;
/ / C h e c k i f t h e r e a r e a n y s e t t i n g s w i t h i s R e g i s t e r e d = 1
const registeredSettings = await this . $query (
"SELECT * FROM settings WHERE isRegistered = 1" ,
) ;
console . log ( "📋 DEBUG: All registered settings:" , registeredSettings ) ;
/ / C h e c k a l l s e t t i n g s f o r t h i s u s e r
const allSettings = await this . $query ( "SELECT * FROM settings" ) ;
console . log ( "📋 DEBUG: All settings in database:" , allSettings ) ;
} catch ( error ) {
console . log ( "📋 DEBUG: Error checking raw database:" , error ) ;
}
}
this . activeDid = settings ? . activeDid || "" ;
this . apiServer = settings ? . apiServer || "" ;
this . firstName = settings ? . firstName || "" ;
this . isRegistered = ! ! settings ? . isRegistered ;
console . log ( "📋 DEBUG: activeDid =" , this . activeDid ) ;
console . log ( "📋 DEBUG: apiServer =" , this . apiServer ) ;
console . log ( "📋 DEBUG: firstName =" , this . firstName ) ;
console . log ( "📋 DEBUG: isRegistered =" , this . isRegistered ) ;
if ( this . isRegistered ) {
console . log ( "📋 DEBUG: User is registered, checking for meetings..." ) ;
await this . fetchMeetings ( ) ;
} else {
console . log ( "📋 DEBUG: User is NOT registered, skipping meeting check" ) ;
}
}
async fetchMeetings ( ) {
console . log ( "📋 DEBUG: fetchMeetings() called" ) ;
console . log ( "📋 DEBUG: activeDid =" , this . activeDid ) ;
console . log ( "📋 DEBUG: apiServer =" , this . apiServer ) ;
this . isLoading = true ;
try {
/ / g e t t h e m e e t i n g t h a t t h e u s e r i s a t t e n d i n g
console . log ( "📋 DEBUG: Checking if user is attending a meeting..." ) ;
const headers = await getHeaders ( this . activeDid ) ;
console . log ( "📋 DEBUG: Headers obtained:" , headers ) ;
const response = await this . axios . get (
this . apiServer + "/api/partner/groupOnboardMember" ,
{ headers } ,
) ;
console . log ( "📋 DEBUG: Member response:" , response . data ) ;
if ( response . data ? . data ) {
/ / t h e y ' r e i n a m e e t i n g a l r e a d y
console . log (
"📋 DEBUG: User is attending a meeting, fetching details..." ,
) ;
const attendingMeetingId = response . data . data . groupId ;
/ / r e t r i e v e t h e m e e t i n g d e t a i l s
console . log ( "📋 DEBUG: Attending meeting ID:" , attendingMeetingId ) ;
const headers2 = await getHeaders ( this . activeDid ) ;
const response2 = await this . axios . get (
this . apiServer + "/api/partner/groupOnboard/" + attendingMeetingId ,
{ headers : headers2 } ,
) ;
console . log ( "📋 DEBUG: Meeting details response:" , response2 . data ) ;
if ( response2 . data ? . data ) {
console . log ( "📋 DEBUG: Setting attendingMeeting" ) ;
this . attendingMeeting = response2 . data . data ;
console . log ( "📋 DEBUG: attendingMeeting set:" , this . attendingMeeting ) ;
return ;
} else {
/ / t h i s s h o u l d n e v e r h a p p e n
logConsoleAndDb (
console . log (
"📋 DEBUG: ERROR: No meeting details found for attending meeting" ,
) ;
this . $logAndConsole (
"Error fetching meeting for user after saying they are in one." ,
true ,
) ;
}
} else {
console . log ( "📋 DEBUG: User is NOT attending a meeting" ) ;
}
console . log ( "📋 DEBUG: Fetching available meetings..." ) ;
const headers2 = await getHeaders ( this . activeDid ) ;
const response2 = await this . axios . get (
this . apiServer + "/api/partner/groupsOnboarding" ,
{ headers : headers2 } ,
) ;
console . log ( "📋 DEBUG: Available meetings response:" , response2 . data ) ;
if ( response2 . data ? . data ) {
console . log ( "📋 DEBUG: Setting meetings list" ) ;
this . meetings = response2 . data . data ;
console . log ( "📋 DEBUG: meetings set:" , this . meetings ) ;
} else {
console . log ( "📋 DEBUG: No meetings found" ) ;
}
} catch ( error ) {
logConsoleAndDb (
} catch ( error : any ) {
console . log ( "📋 DEBUG: Error fetching meetings:" , error ) ;
console . log ( "📋 DEBUG: Error response:" , error . response ? . data ) ;
this . $logAndConsole (
"Error fetching meetings: " + errorStringForLog ( error ) ,
true ,
) ;
@ -224,7 +318,7 @@ export default class OnboardMeetingListView extends Vue {
async submitPassword ( ) {
if ( ! this . selectedMeeting ) {
/ / t h i s s h o u l d n e v e r h a p p e n
logConsoleAndDb (
this . $ logAnd Console(
"No meeting selected when prompting for password, which should never happen." ,
true ,
) ;
@ -275,7 +369,7 @@ export default class OnboardMeetingListView extends Vue {
throw { response : postResult } ;
}
} catch ( error ) {
logConsoleAndDb (
this . $ logAnd Console(
"Error joining meeting: " + errorStringForLog ( error ) ,
true ,
) ;
@ -320,7 +414,7 @@ export default class OnboardMeetingListView extends Vue {
5000 ,
) ;
} catch ( error ) {
logConsoleAndDb (
this . $ logAnd Console(
"Error leaving meeting: " + errorStringForLog ( error ) ,
true ,
) ;
@ -341,5 +435,10 @@ export default class OnboardMeetingListView extends Vue {
- 1 ,
) ;
}
createMeeting ( ) {
console . log ( "📋 DEBUG: createMeeting() called - routing to meeting setup" ) ;
this . $router . push ( { name : "onboard-meeting-setup" } ) ;
}
}
< / script >