diff --git a/frontend/src/pages/chat/openProfilePopup.ts b/frontend/src/pages/chat/openProfilePopup.ts index 0245366..ffd876e 100644 --- a/frontend/src/pages/chat/openProfilePopup.ts +++ b/frontend/src/pages/chat/openProfilePopup.ts @@ -6,14 +6,14 @@ export async function openProfilePopup(profil: ClientProfil) { modalname.innerHTML = `
- Profil of ${profil.user}
- Login Name: '${profil.loginName ?? 'Guest'}' + Profil of ${profil.user} + Login status: '${profil.loginName ?? 'Guest'}'
Login ID: '${profil.userID ?? ''}'
-
About: '${profil.text}'
+
About: '${profil.text}'
`; const profilList = document.getElementById("profile-modal") ?? null; diff --git a/src/chat/src/makeProfil.ts b/src/chat/src/makeProfil.ts index 04745ef..6b75d4c 100644 --- a/src/chat/src/makeProfil.ts +++ b/src/chat/src/makeProfil.ts @@ -19,16 +19,17 @@ export async function makeProfil(fastify: FastifyInstance, user: string, socket: let clientProfil!: ClientProfil; const users: User[] = fastify.db.getAllUsers() ?? []; const allUsers: User | null = getUserByName(users, user); - // console.log(color.yellow, `DEBUG LOG: 'userFound is:'${allUsers?.name}`); if (user === allUsers?.name) { - // console.log(color.yellow, `DEBUG LOG: 'login Name: '${allUsers.login}' user: '${user}'`); + let loginState = `${allUsers?.login ?? 'Guest'}` + if (loginState !== 'Guest') + loginState = 'Member'; clientProfil = { command: 'makeProfil', destination: 'profilMsg', type: 'chat' as const, user: `${allUsers.name}`, - loginName: `${allUsers?.login ?? 'Guest'}`, + loginName: loginState, userID: `${allUsers?.id ?? ''}`, text: escape(allUsers.desc), timestamp: Date.now(),