feat: update session creation to hydrate data immediately
Update `createSession` to return the session ID, allowing the UI to automatically set the active session and trigger a server hydration immediately after creation. This ensures the UI reflects the new session state without a manual refresh.
This commit is contained in:
@@ -25,7 +25,11 @@ export const ConnectionBar: Component = () => {
|
||||
const handleCreateSession = () => {
|
||||
const name = newSessionName().trim();
|
||||
if (!name) return;
|
||||
createSession(name);
|
||||
const id = createSession(name);
|
||||
if (id) {
|
||||
setSessionId(id);
|
||||
hydrateFromServer(id).catch(() => {});
|
||||
}
|
||||
setNewSessionName("");
|
||||
setShowNewSession(false);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user