diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-08-19 15:08:44 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-08-19 15:08:44 -0400 |
| commit | 4624f4dbebf5dd1ed4dc5168573537459b9a115e (patch) | |
| tree | 0999dedeea07d527255613bec8bd84e34e0501ed /ui/lib | |
| parent | 4ace27830ffea715c30f366765aeb231572c60ec (diff) | |
| parent | 3119ef0f004b576d67737bebf517947f8819b4fa (diff) | |
Merge branch 'no-prerendered-markdown'
Diffstat (limited to 'ui/lib')
| -rw-r--r-- | ui/lib/components/Message.svelte | 5 | ||||
| -rw-r--r-- | ui/lib/outbox.svelte.js | 2 | ||||
| -rw-r--r-- | ui/lib/session.svelte.js | 6 | ||||
| -rw-r--r-- | ui/lib/state/remote/messages.svelte.js | 5 |
4 files changed, 7 insertions, 11 deletions
diff --git a/ui/lib/components/Message.svelte b/ui/lib/components/Message.svelte index 4c6979e..6dbd7b2 100644 --- a/ui/lib/components/Message.svelte +++ b/ui/lib/components/Message.svelte @@ -1,16 +1,19 @@ <script> import { DateTime } from 'luxon'; + import { render } from '$lib/markdown.js'; + let { class: cssClass, id, at, - renderedBody, + body, editable = false, deleteMessage = async (id) => {}, } = $props(); let deleteArmed = $state(false); let atFormatted = $derived(at.toLocaleString(DateTime.DATETIME_SHORT)); + let renderedBody = $derived(render(body)); function ondelete(event) { event.preventDefault(); diff --git a/ui/lib/outbox.svelte.js b/ui/lib/outbox.svelte.js index c4e2324..74f41bc 100644 --- a/ui/lib/outbox.svelte.js +++ b/ui/lib/outbox.svelte.js @@ -9,7 +9,6 @@ class SendToConversation { this.conversation = conversation; this.body = body; this.at = DateTime.now(); - this.renderedBody = md.render(body); } toSkeleton(sender) { @@ -19,7 +18,6 @@ class SendToConversation { conversation: this.conversation, sender, body: this.body, - renderedBody: this.renderedBody, }; } diff --git a/ui/lib/session.svelte.js b/ui/lib/session.svelte.js index 4430e8a..42b86f0 100644 --- a/ui/lib/session.svelte.js +++ b/ui/lib/session.svelte.js @@ -29,24 +29,22 @@ class Conversation { } class Message { - static fromRemote({ id, at, conversation, sender, body, renderedBody }, users) { + static fromRemote({ id, at, conversation, sender, body }, users) { return new Message({ id, at, conversation, sender: users.get(sender), body, - renderedBody, }); } - constructor({ id, at, conversation, sender, body, renderedBody }) { + constructor({ id, at, conversation, sender, body }) { this.id = id; this.at = at; this.conversation = conversation; this.sender = sender; this.body = body; - this.renderedBody = renderedBody; } } diff --git a/ui/lib/state/remote/messages.svelte.js b/ui/lib/state/remote/messages.svelte.js index 852f29e..10de27a 100644 --- a/ui/lib/state/remote/messages.svelte.js +++ b/ui/lib/state/remote/messages.svelte.js @@ -1,5 +1,4 @@ import { DateTime } from 'luxon'; -import { render } from '$lib/markdown.js'; class Message { static boot({ id, at, conversation, sender, body }) { @@ -9,17 +8,15 @@ class Message { conversation, sender, body, - renderedBody: render(body), }); } - constructor({ id, at, conversation, sender, body, renderedBody }) { + constructor({ id, at, conversation, sender, body }) { this.id = id; this.at = at; this.conversation = conversation; this.sender = sender; this.body = body; - this.renderedBody = renderedBody; } } |
