Enable full mode with multiple rooms
This commit is contained in:
parent
a8b7eaf20e
commit
f6bea700f0
24 changed files with 767 additions and 286 deletions
17
src/lib/active.svelte.ts
Normal file
17
src/lib/active.svelte.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { GROUP_ID, MODE } from "$lib/config";
|
||||
|
||||
// The group the user is currently acting within (posting, chatting, joining).
|
||||
// Simple mode has exactly one group; full mode follows the room or thread being
|
||||
// viewed. GROUP_ID is never assumed in full mode — this is the single source of
|
||||
// truth for "which group".
|
||||
let current = $state<string>(MODE === "full" ? "" : GROUP_ID);
|
||||
|
||||
export const activeGroup = {
|
||||
get id() {
|
||||
return current;
|
||||
},
|
||||
};
|
||||
|
||||
export function setActiveGroup(id: string) {
|
||||
if (id) current = id;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue