summaryrefslogtreecommitdiff
path: root/ui/lib/state/remote
diff options
context:
space:
mode:
Diffstat (limited to 'ui/lib/state/remote')
-rw-r--r--ui/lib/state/remote/channels.svelte.js5
-rw-r--r--ui/lib/state/remote/messages.svelte.js7
2 files changed, 3 insertions, 9 deletions
diff --git a/ui/lib/state/remote/channels.svelte.js b/ui/lib/state/remote/channels.svelte.js
index b6da31b..8b190dd 100644
--- a/ui/lib/state/remote/channels.svelte.js
+++ b/ui/lib/state/remote/channels.svelte.js
@@ -1,5 +1,4 @@
import { DateTime } from 'luxon';
-import { SvelteMap } from 'svelte/reactivity';
class Channel {
static boot({ at, id, name }) {
@@ -18,10 +17,10 @@ class Channel {
}
export class Channels {
- all = $state();
+ all = $state([]);
static boot(channels) {
- const all = new SvelteMap(channels.map((channel) => [channel.id, Channel.boot(channel)]));
+ const all = channels.map((channel) => Channel.boot(channel));
return new Channels({ all });
}
diff --git a/ui/lib/state/remote/messages.svelte.js b/ui/lib/state/remote/messages.svelte.js
index c6d31f0..0a081bb 100644
--- a/ui/lib/state/remote/messages.svelte.js
+++ b/ui/lib/state/remote/messages.svelte.js
@@ -1,7 +1,7 @@
import { DateTime } from 'luxon';
import { render } from '$lib/markdown.js';
-export class Message {
+class Message {
static boot({ id, at, channel, sender, body }) {
return new Message({
id,
@@ -21,11 +21,6 @@ export class Message {
this.body = body;
this.renderedBody = renderedBody;
}
-
- resolve(get) {
- const { sender, ...rest } = this;
- return new Message({ sender: get.sender(sender), ...rest });
- }
}
export class Messages {