MCPcopy Create free account
hub / github.com/experdot/pointer / switchBranch

Function switchBranch

src/renderer/src/services/messagesService.ts:135–145  ·  view source on GitHub ↗
(pageId: string, messageId: string)

Source from the content-addressed store, hash-verified

133}
134
135export async function switchBranch(pageId: string, messageId: string): Promise<void> {
136 const record = stores.message.get(pageId)
137 if (!record) return
138
139 const { childrenMap } = buildMessageMaps(record.messages)
140 const leafId = findLeafFromMessage(childrenMap, messageId)
141 await stores.message.updateSession(pageId, {
142 leafMessageId: leafId,
143 selectedMessageId: messageId
144 })
145}
146
147function findLeafFromMessage(
148 childrenMap: Map<string | undefined, ChatMessage[]>,

Callers

nothing calls this directly

Calls 4

buildMessageMapsFunction · 0.85
findLeafFromMessageFunction · 0.85
updateSessionMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected