MCPcopy Index your code
hub / github.com/pingdotgg/t3code / markThreadUnread

Function markThreadUnread

apps/web/src/uiStateStore.ts:252–275  ·  view source on GitHub ↗
(
  state: UiState,
  threadId: string,
  latestTurnCompletedAt: string | null | undefined,
)

Source from the content-addressed store, hash-verified

250}
251
252export function markThreadUnread(
253 state: UiState,
254 threadId: string,
255 latestTurnCompletedAt: string | null | undefined,
256): UiState {
257 if (!latestTurnCompletedAt) {
258 return state;
259 }
260 const latestTurnCompletedAtMs = Date.parse(latestTurnCompletedAt);
261 if (Number.isNaN(latestTurnCompletedAtMs)) {
262 return state;
263 }
264 const unreadVisitedAt = new Date(latestTurnCompletedAtMs - 1).toISOString();
265 if (state.threadLastVisitedAtById[threadId] === unreadVisitedAt) {
266 return state;
267 }
268 return {
269 ...state,
270 threadLastVisitedAtById: {
271 ...state.threadLastVisitedAtById,
272 [threadId]: unreadVisitedAt,
273 },
274 };
275}
276
277export function setThreadChangedFilesExpanded(
278 state: UiState,

Callers 3

uiStateStore.tsFile · 0.85
Sidebar.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected