fix(journal): decouple broker from session
The broker connection now persists across session changes. Joining or switching a session swaps subscriptions instead of reconnecting, and a lobby lets sessions be listed and created before joining one. Fixes session switching being a no-op (the store only updated local state) and session creation being unreachable before connecting. Also removes the dead ConnectionBar and the no-op hydrateFromServer/setSessionId store calls.
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
import { Component, createSignal, For, Show } from "solid-js";
|
||||
import {
|
||||
sessions,
|
||||
setSessionId,
|
||||
hydrateFromServer,
|
||||
joinSession,
|
||||
useJournalStream,
|
||||
} from "../stores/journalStream";
|
||||
|
||||
@@ -25,8 +24,9 @@ export const SessionDropdown: Component<SessionDropdownProps> = (props) => {
|
||||
return;
|
||||
}
|
||||
setDropdownOpen(false);
|
||||
setSessionId(id);
|
||||
hydrateFromServer(id).catch(() => {});
|
||||
joinSession(id).catch((e) => {
|
||||
console.error("[journal] failed to switch session:", e);
|
||||
});
|
||||
};
|
||||
|
||||
// Close dropdown on outside click
|
||||
|
||||
Reference in New Issue
Block a user