summaryrefslogtreecommitdiff
path: root/ui/lib/components/ActiveChannel.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-03 21:47:30 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-03 21:47:30 -0500
commit65381f49cc9abce98c1c63c399fdcfc8ce76c3f5 (patch)
treee0b1eea57aa8b431aa83e2efc4577c12d3cc2b29 /ui/lib/components/ActiveChannel.svelte
parent30fa0c4c1faece6b054105fe3cce5107f24a2fa2 (diff)
parentf38881f3253b3a128154ffd95655859e3dc629dc (diff)
Merge remote-tracking branch 'origin/wip/actually-configure-prettier'
Diffstat (limited to 'ui/lib/components/ActiveChannel.svelte')
-rw-r--r--ui/lib/components/ActiveChannel.svelte62
1 files changed, 31 insertions, 31 deletions
diff --git a/ui/lib/components/ActiveChannel.svelte b/ui/lib/components/ActiveChannel.svelte
index ac1a0b9..a4ccd24 100644
--- a/ui/lib/components/ActiveChannel.svelte
+++ b/ui/lib/components/ActiveChannel.svelte
@@ -1,42 +1,42 @@
<script>
- import { messages } from '$lib/store';
- import MessageRun from './MessageRun.svelte';
+ import { messages } from '$lib/store';
+ import MessageRun from './MessageRun.svelte';
- let { channel } = $props();
- let messageList = $derived(channel !== null ? $messages.inChannel(channel) : []);
+ let { channel } = $props();
+ let messageList = $derived(channel !== null ? $messages.inChannel(channel) : []);
- function* chunkBy(xs, fn) {
- let chunk;
- let key;
- for (let x of xs) {
- let newKey = fn(x);
- if (key !== newKey) {
- if (chunk !== undefined) {
- yield [key, chunk];
- }
+ function* chunkBy(xs, fn) {
+ let chunk;
+ let key;
+ for (let x of xs) {
+ let newKey = fn(x);
+ if (key !== newKey) {
+ if (chunk !== undefined) {
+ yield [key, chunk];
+ }
- chunk = [x];
- key = newKey;
- } else {
- chunk.push(x);
- }
- }
- if (chunk !== undefined) {
- yield [key, chunk];
- }
- }
+ chunk = [x];
+ key = newKey;
+ } else {
+ chunk.push(x);
+ }
+ }
+ if (chunk !== undefined) {
+ yield [key, chunk];
+ }
+ }
</script>
<div class="container">
- {#each chunkBy(messageList, (msg) => msg.sender) as [sender, messages]}
- <div>
- <MessageRun {sender} {messages} />
- </div>
- {/each}
+ {#each chunkBy(messageList, (msg) => msg.sender) as [sender, messages]}
+ <div>
+ <MessageRun {sender} {messages} />
+ </div>
+ {/each}
</div>
<style>
- .container {
- overflow: auto;
- }
+ .container {
+ overflow: auto;
+ }
</style>