184-message-truncation #186

Merged
hodlbod merged 3 commits from priyanshu_bharti/flotilla:184-message-truncation into dev 2026-04-10 16:37:24 +00:00
+8 -2
View File
@@ -8,16 +8,22 @@
import {getRoomItemPath} from "@app/util/routes"
const props: ComponentProps<typeof NoteContent> = $props()
const MESSAGE_MIN_LENGTH = 5000
const MESSAGE_MAX_LENGTH = 5500
const path = getRoomItemPath(props.url!, props.event)
const minLength =
props.minLength ?? (props.event.kind === MESSAGE ? MESSAGE_MIN_LENGTH : undefined)
const maxLength =
props.maxLength ?? (props.event.kind === MESSAGE ? MESSAGE_MAX_LENGTH : undefined)
</script>
<div class={cx("text-sm", {"card2 card2-sm bg-alt": props.event.kind !== MESSAGE})}>
{#if path && !isMobile}
<Link href={path}>
<NoteContent {...props} />
<NoteContent {...props} {minLength} {maxLength} />
</Link>
{:else}
<NoteContent {...props} />
<NoteContent {...props} {minLength} {maxLength} />
{/if}
</div>