same-person-but-title

This commit is contained in:
tonyrewin 2022-12-07 10:50:24 +03:00
parent fe4f55ad11
commit 47822553bd
3 changed files with 3 additions and 7 deletions

View File

@ -39,11 +39,7 @@ const DialogCard = (props: DialogProps) => {
</Switch>
</div>
<div class={styles.row}>
<div class={styles.name}>
<Switch fallback={names()}>
<Match when={companions().length > 1}>{props.title}</Match>
</Switch>
</div>
<div class={styles.name}>{props.title}</div>
<div class={styles.message}>
<Switch>
<Match when={props.message && !props.isChatHeader}>{props.message}</Match>

View File

@ -11,7 +11,7 @@ const DialogHeader = (props: DialogHeader) => {
<header class={styles.DialogHeader}>
<DialogCard
isChatHeader={true}
title={props.chat.title}
title={props.chat.title || props.chat.members[0].name}
members={props.chat.members}
ownId={props.ownId}
/>

View File

@ -185,7 +185,7 @@ export const InboxView = () => {
{(chat) => (
<DialogCard
onClick={() => handleOpenChat(chat)}
title={chat.title}
title={chat.title || chat.members[0].name}
members={chat.members}
ownId={currentUserId()}
lastUpdate={chat.updatedAt}