MCPcopy
hub / github.com/coder/mux / getWorkspaceUnreadState

Function getWorkspaceUnreadState

tests/ui/chat/unreadIndicator.test.ts:28–38  ·  view source on GitHub ↗

* Get the unread state for a workspace from the WorkspaceStore.

(workspaceId: string)

Source from the content-addressed store, hash-verified

26 * Get the unread state for a workspace from the WorkspaceStore.
27 */
28function getWorkspaceUnreadState(workspaceId: string): {
29 recencyTimestamp: number | null;
30 isUnread: (lastReadTimestamp: number) => boolean;
31} {
32 const state = workspaceStore.getWorkspaceSidebarState(workspaceId);
33 return {
34 recencyTimestamp: state.recencyTimestamp,
35 isUnread: (lastReadTimestamp: number) =>
36 state.recencyTimestamp !== null && state.recencyTimestamp > lastReadTimestamp,
37 };
38}
39
40/**
41 * Get the lastReadTimestamp from persisted state.

Callers 1

Calls 1

Tested by

no test coverage detected