Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions frontend/src/components/Communications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,8 @@
: 'justify-start',
]"
>
<!-- Author avatar for messages (on the left side) -->
<div
v-if="thread.kind !== ThreadKind.ThreadKindPhoneCall"
class="flex flex-col items-center gap-1"
>
<!-- Author avatar for messages (including phone calls) -->
<div class="flex flex-col items-center gap-1">
<Image
v-if="getAuthorAvatar(getMessageAuthor(thread))"
:src="getAuthorAvatar(getMessageAuthor(thread))"
Expand Down Expand Up @@ -958,14 +955,20 @@ watch(

const getMessageDirection = (kind: ThreadKind): "incoming" | "outgoing" => {
return kind === ThreadKind.ThreadKindTo ||
kind === ThreadKind.ThreadKindTemplate
kind === ThreadKind.ThreadKindTemplate ||
kind === ThreadKind.ThreadKindPhoneCall
? "outgoing"
: "incoming";
};

const getMessageAuthor = (thread: ThreadWithEntry): Author | null => {
const direction = getMessageDirection(thread.kind);

// For phone calls, always show the member who made the call
if (thread.kind === ThreadKind.ThreadKindPhoneCall && thread.entry?.member) {
return getMemberById(thread.entry.member);
}

if (direction === "outgoing" && thread.entry?.member) {
return getMemberById(thread.entry?.member);
} else if (direction === "incoming") {
Expand Down
Loading