diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-01-11 13:34:13 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-01-11 13:34:13 -0500 |
| commit | 6d51f8568e337e768505ccfdef916b84dd6eb1b3 (patch) | |
| tree | dec4545ccbe44c8e2baf6e633308359f40ac610a /ui/lib/store | |
| parent | d858fc8105cfe6333671426fe0e43302bceace92 (diff) | |
npm run format
Diffstat (limited to 'ui/lib/store')
| -rw-r--r-- | ui/lib/store/channels.svelte.js | 9 | ||||
| -rw-r--r-- | ui/lib/store/messages.svelte.js | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/ui/lib/store/channels.svelte.js b/ui/lib/store/channels.svelte.js index 8919be0..c82f9aa 100644 --- a/ui/lib/store/channels.svelte.js +++ b/ui/lib/store/channels.svelte.js @@ -1,5 +1,5 @@ import { DateTime } from 'luxon'; -const EPOCH_STRING = "1970-01-01T00:00:00Z"; +const EPOCH_STRING = '1970-01-01T00:00:00Z'; // For reasons unclear to me, a straight up class definition with a constructor // doesn't seem to work, reactively. So we resort to this. @@ -15,7 +15,7 @@ function makeChannelObject({ id, name, draft = '', lastReadAt = null, scrollPosi name, lastReadAt: lastReadAt || DateTime.fromISO(EPOCH_STRING), draft, - scrollPosition, + scrollPosition }; } @@ -33,10 +33,7 @@ export class Channels { } addChannel(id, name) { - this.channels = [ - ...this.channels, - makeChannelObject({ id, name }), - ]; + this.channels = [...this.channels, makeChannelObject({ id, name })]; this.sort(); return this; } diff --git a/ui/lib/store/messages.svelte.js b/ui/lib/store/messages.svelte.js index ba4c895..dadade6 100644 --- a/ui/lib/store/messages.svelte.js +++ b/ui/lib/store/messages.svelte.js @@ -5,7 +5,7 @@ import DOMPurify from 'dompurify'; const RUN_COALESCE_MAX_INTERVAL = 10 /* min */ * 60 /* sec */ * 1000; /* ms */ export class Messages { - channels = $state({}); // Mapping<ChannelId, Message> + channels = $state({}); // Mapping<ChannelId, Message> inChannel(channel) { return this.channels[channel] || []; |
