MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / markInboxThreadRead

Function markInboxThreadRead

src/app/app-shell/useInboxAutoReadSync.ts:32–59  ·  view source on GitHub ↗
({
  invokeDesktopAction,
  loadProjectThreads,
  queryClient,
  thread,
  warningMessage,
}: {
  invokeDesktopAction: DesktopActionInvoker
  loadProjectThreads: (projectId: string) => Promise<unknown>
  queryClient: QueryClient
  thread: InboxThread
  warningMessage: string
})

Source from the content-addressed store, hash-verified

30}
31
32function markInboxThreadRead({
33 invokeDesktopAction,
34 loadProjectThreads,
35 queryClient,
36 thread,
37 warningMessage,
38}: {
39 invokeDesktopAction: DesktopActionInvoker
40 loadProjectThreads: (projectId: string) => Promise<unknown>
41 queryClient: QueryClient
42 thread: InboxThread
43 warningMessage: string
44}) {
45 void invokeDesktopAction('inbox.mark-read', {
46 projectId: thread.projectId,
47 sessionPath: thread.sessionPath,
48 })
49 .then(async () => {
50 await refreshInboxThreadState({
51 loadProjectThreads,
52 projectId: thread.projectId,
53 queryClient,
54 })
55 })
56 .catch((error) => {
57 console.warn(warningMessage, error)
58 })
59}
60
61function syncInboxAutoReadSelection(
62 input: Omit<UseInboxAutoReadSyncInput, 'workspaceState'> & {

Callers 1

Calls 2

invokeDesktopActionFunction · 0.85
refreshInboxThreadStateFunction · 0.85

Tested by

no test coverage detected