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

Function stopActiveWork

src/renderer/src/services/switchTransactionService.ts:33–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33async function stopActiveWork(): Promise<void> {
34 const stopped = await streamingManager.stopAll()
35 const currentContext = persistence.database.getActiveContext()
36 if (currentContext.accountId && currentContext.workspacePath) {
37 for (const item of stopped) {
38 if (item.content) {
39 await messagesService.updateMessage(item.pageId, item.messageId, {
40 content: item.content,
41 reasoning_content: item.reasoning
42 })
43 } else {
44 await messagesService.deleteMessage(item.pageId, item.messageId)
45 }
46 }
47 }
48 streamingManager.reset()
49 await flushAllPersistenceQueues()
50}
51
52async function waitForScopedWrites(scope: WorkspaceScope | null): Promise<void> {
53 const context = persistence.database.getActiveContext()

Callers 1

runSwitchTransactionFunction · 0.85

Calls 5

stopAllMethod · 0.80
getActiveContextMethod · 0.80
updateMessageMethod · 0.80
resetMethod · 0.65

Tested by

no test coverage detected