fix(web): read the live server status in the page sheet
The navigation sheet took its status from `server.status` on the cached /info payload, which stays `"online"` (or `"offline"` once stored) regardless of the live probe, and rendered an empty version when `pluginVersion` was "". Use the connection store's `serverStatus` and fall back through `version` with `||`, and cover both the localized status fact and the empty-`pluginVersion` path.
This commit is contained in:
1 parent
ec80ee4bab
commit
611c405439
2 files changed
+99
-2
No files matched your search
@@ -32,10 +32,11 @@ export function PageSheet({ open, onOpenChange, page, onSearch, returnFocusTo }:
|
||||
const workspaces = useWorkspacesStore((state) => state.items);
|
||||
const byWorkspace = useSessionsStore((state) => state.byWorkspace);
|
||||
const server = useConnectionStore((state) => state.server);
|
||||
const serverStatus = useConnectionStore((s) => s.serverStatus);
|
||||
|
||||
const sessionCount = Object.values(byWorkspace).reduce((total, list) => total + list.length, 0);
|
||||
const status = server?.status ?? "unknown";
|
||||
const version = server?.pluginVersion ?? server?.version ?? "";
|
||||
const status = serverStatus;
|
||||
const version = server?.pluginVersion || server?.version || "";
|
||||
|
||||
function fact(key: NavKey): string {
|
||||
if (key === "workspaces") return t("shell.pageFactWorkspaces", { n: workspaces.length });
|
||||
|
||||
Reference in new issue
Block a user