收口 Makelore 客户端变更
This commit is contained in:
@@ -105,6 +105,25 @@ export function patchProjectSessionMetadata(
|
||||
return { schemaVersion: 1, sessions, updatedAt: now };
|
||||
}
|
||||
|
||||
/**
|
||||
* Reading a session changes its unread state, not its activity timestamp.
|
||||
* Keeping those concerns separate prevents a navigation click from moving an
|
||||
* Agent in a list that is ordered by the latest conversation activity.
|
||||
*/
|
||||
export function markProjectSessionRead(
|
||||
state: ProjectConversationState,
|
||||
sessionId: string,
|
||||
now = new Date().toISOString(),
|
||||
): ProjectConversationState {
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
sessions: state.sessions.map((item) => item.sessionId === sessionId
|
||||
? { ...item, unreadCount: 0 }
|
||||
: item),
|
||||
updatedAt: now,
|
||||
};
|
||||
}
|
||||
|
||||
export function removeProjectSessionMetadata(
|
||||
state: ProjectConversationState,
|
||||
sessionId: string,
|
||||
|
||||
Reference in New Issue
Block a user