diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-02-24 12:26:20 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-02-24 12:26:20 -0500 |
| commit | 770400bcb5953dcb762b5c80d90e8e26e778b504 (patch) | |
| tree | 174e258c5f29397bcb51c8762cb1324d13202aa5 | |
| parent | e561ff74b81209b8e0f0c7cc63861a2ef70d19bf (diff) | |
Move constant closer to usage
| -rw-r--r-- | ui/lib/constants.js | 1 | ||||
| -rw-r--r-- | ui/routes/(app)/+layout.svelte | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ui/lib/constants.js b/ui/lib/constants.js index 5456414..f854f5d 100644 --- a/ui/lib/constants.js +++ b/ui/lib/constants.js @@ -1,4 +1,3 @@ export const EPOCH_STRING = '1970-01-01T00:00:00Z'; export const STORE_KEY_CHANNELS_DATA = 'pilcrow:channelsData'; -export const STORE_KEY_LAST_ACTIVE = 'pilcrow:lastActiveChannel'; diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte index 20620d4..572a551 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -8,7 +8,6 @@ import TinyGesture from 'tinygesture'; import { boot, subscribeToEvents } from '$lib/apiServer'; - import { STORE_KEY_LAST_ACTIVE } from '$lib/constants'; import { channelsList, channelsMetaList, currentUser, logins, messages, onEvent } from '$lib/store'; import ChannelList from '$lib/components/ChannelList.svelte'; import CreateChannelForm from '$lib/components/CreateChannelForm.svelte'; @@ -115,6 +114,8 @@ return ''; } + const STORE_KEY_LAST_ACTIVE = 'pilcrow:lastActiveChannel'; + function getLastActiveChannel() { return ( browser && JSON.parse(localStorage.getItem(STORE_KEY_LAST_ACTIVE)) |
