chore: minor code cleanup
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
Twig 2025-07-14 21:39:42 +02:00
parent e7558d9a95
commit cbc010943c
No known key found for this signature in database
3 changed files with 15 additions and 18 deletions

View file

@ -13,7 +13,7 @@
<VerticalSpacer /> <VerticalSpacer />
<div id="direct-message-list"> <div id="direct-message-list">
<UserEntry v-for="user of friends" :user="user" :name="user.display_name || user.username" <UserEntry v-for="user of friends" :user="user"
:href="`/me/${user.uuid}`"/> :href="`/me/${user.uuid}`"/>
</div> </div>
</div> </div>

View file

@ -4,22 +4,16 @@
:editing.sync="props.editing" :replying-to.sync="props.replyingTo"> :editing.sync="props.editing" :replying-to.sync="props.replyingTo">
<div v-if="props.replyMessage" class="message-reply-svg"> <div v-if="props.replyMessage" class="message-reply-svg">
<svg <svg
width="1.5em" width="1.5em" height="1.5em"
height="1.5em" viewBox="0 0 151.14355 87.562065" version="1.1" id="svg1"
viewBox="0 0 151.14355 87.562065"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"
style="overflow: visible;"> style="overflow: visible;">
<defs <defs id="defs1" />
id="defs1" /> <g id="layer1"
<g
id="layer1"
transform="translate(40,-35)"> transform="translate(40,-35)">
<g <g id="g3"
id="g3" transform="translate(-35,-20)">
transform="translate(-35,-20)">
<path <path
style="stroke:var(--reply-text-color);stroke-width:8;stroke-opacity:1" style="stroke:var(--reply-text-color);stroke-width:8;stroke-opacity:1"
d="m 120.02168,87.850978 100.76157,2.4e-5" d="m 120.02168,87.850978 100.76157,2.4e-5"
@ -32,16 +26,17 @@
</g> </g>
</svg> </svg>
</div> </div>
<MessageReply v-if="props.replyMessage" :author="props.replyMessage.user.display_name || props.replyMessage.user.username" :text="props.replyMessage?.message" <MessageReply v-if="props.replyMessage" :id="props.message.uuid"
:id="props.message.uuid" :reply-id="props.replyMessage.uuid" max-width="reply" /> :author="props.replyMessage.user.display_name || props.replyMessage.user.username"
:text="props.replyMessage?.message"
:reply-id="props.replyMessage.uuid" max-width="reply" />
<div class="left-column"> <div class="left-column">
<img v-if="props.img" class="message-author-avatar" :src="props.img" :alt="author?.display_name || author?.username" /> <Avatar :user="props.author" class="message-author-avatar"/>
<Icon v-else name="lucide:user" class="message-author-avatar" />
</div> </div>
<div class="message-data"> <div class="message-data">
<div class="message-metadata"> <div class="message-metadata">
<span class="message-author-username" tabindex="0" :style="`color: ${props.authorColor}`"> <span class="message-author-username" tabindex="0" :style="`color: ${props.authorColor}`">
{{ author?.display_name || author?.username }} {{ displayName }}
</span> </span>
<span class="message-date" :title="date.toString()"> <span class="message-date" :title="date.toString()">
<span v-if="getDayDifference(date, currentDate) === 1">Yesterday at</span> <span v-if="getDayDifference(date, currentDate) === 1">Yesterday at</span>
@ -85,6 +80,7 @@ const dateHidden = ref<boolean>(true);
const date = new Date(props.timestamp); const date = new Date(props.timestamp);
const currentDate: Date = new Date() const currentDate: Date = new Date()
const displayName = props.author?.display_name || props.author?.username
console.log("[MSG] message to render:", props.message); console.log("[MSG] message to render:", props.message);
console.log("author:", props.author); console.log("author:", props.author);

View file

@ -42,6 +42,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { MessageResponse, ScrollPosition, UserResponse } from '~/types/interfaces'; import type { MessageResponse, ScrollPosition, UserResponse } from '~/types/interfaces';
import scrollToBottom from '~/utils/scrollToBottom'; import scrollToBottom from '~/utils/scrollToBottom';
import { generateIrcColor } from '#imports';
const props = defineProps<{ channelUrl: string, amount?: number, offset?: number }>(); const props = defineProps<{ channelUrl: string, amount?: number, offset?: number }>();