diff options
| author | Kit La Touche <kit@transneptune.net> | 2025-02-16 22:00:57 -0500 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2025-02-20 21:53:25 -0500 |
| commit | daaf37a1ed3760f03fceb1123ebe80de3a2f280c (patch) | |
| tree | e823603aa1683a2c07fd08dde724780147822348 /ui/lib/store.js | |
| parent | 43af74832f9a2fa7f40dc71985eec9b0ada087dd (diff) | |
Separate channel metadata out into its own store
This is stored locally, and, while parallel to channel info, is not the
same as.
Eventually, this may hold info about moot/decayed channels, and grow
unbounded. That'll need to be addressed.
Diffstat (limited to 'ui/lib/store.js')
| -rw-r--r-- | ui/lib/store.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/lib/store.js b/ui/lib/store.js index f408c0c..508320f 100644 --- a/ui/lib/store.js +++ b/ui/lib/store.js @@ -1,13 +1,17 @@ import { writable } from 'svelte/store'; import { browser } from '$app/environment'; -import { Channels } from '$lib/store/channels.svelte.js'; +import { Channels, ChannelsMeta } from '$lib/store/channels.svelte.js'; import { Messages } from '$lib/store/messages.svelte.js'; import { Logins } from '$lib/store/logins'; +import { STORE_KEY_CHANNELS_DATA } from '$lib/constants'; // Get channelsList content from the local storage -const channelsData = (browser && JSON.parse(localStorage.getItem('pilcrow:channelsData'))) || {}; +const channelsMetaData = ( + browser && JSON.parse(localStorage.getItem(STORE_KEY_CHANNELS_DATA)) +) || {}; export const currentUser = writable(null); export const logins = writable(new Logins()); -export const channelsList = writable(new Channels({ channelsData })); +export const channelsMetaList = writable(new ChannelsMeta({ channelsMetaData })); +export const channelsList = writable(new Channels({ channelsMetaList })); export const messages = writable(new Messages()); |
