From 53f86ecc317208c83adf29be109d450b8ea83391 Mon Sep 17 00:00:00 2001 From: Lucas Pinto Date: Fri, 10 Dec 2021 17:34:56 +0000 Subject: [PATCH] sexo com o nome Co-authored-by: PedrosGuitarLegend --- src/containers/ChatContainer.vue | 42 ++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/containers/ChatContainer.vue b/src/containers/ChatContainer.vue index 9aaa603..a562a1e 100644 --- a/src/containers/ChatContainer.vue +++ b/src/containers/ChatContainer.vue @@ -24,8 +24,7 @@ + v-model="filtroGrupos"> @@ -99,7 +98,7 @@ - {{ minifyName(contacto.nome) }} + {{ minifyName(contacto.nome, contacto.grupo, $store.state.user.contacto.emChamada && $store.state.user.contacto.emChamada.nome === contacto.nome) }}
- + + + + + + + + + + -
+
({ ...r, lastIteraction: r.mensagens?.length ? r.mensagens[r.mensagens.length - 1]?.momento?.getTime() : r.createdAt?.getTime() })) .sort((a: Contacto & { lastIteraction: number }, b: Contacto & { lastIteraction: number }) => b.lastIteraction - a.lastIteraction); }, + computedContactosGrupo() { + return this.recenteSeleccionado?.naChamada + .map((c) => c.nome) + .join(', '); + }, }, methods: { - minifyName(nome: string) { - return nome.length >= 12 ? `${nome.slice(0, 9)}...` : nome; + minifyName(nome: string, eGrupo: boolean, emChamada: boolean) { + let cnt = 0; + if (eGrupo) cnt += 3; + if (emChamada) cnt += 3; + + console.log(nome, cnt); + return nome.length >= 15 - cnt ? `${nome.slice(0, 13 - cnt)}...` : nome; }, openCriarGrupo() { this.dialogCriarGrupo = true;