({
invokeDesktopAction,
loadProjectThreads,
queryClient,
thread,
warningMessage,
}: {
invokeDesktopAction: DesktopActionInvoker
loadProjectThreads: (projectId: string) => Promise<unknown>
queryClient: QueryClient
thread: InboxThread
warningMessage: string
})
| 30 | } |
| 31 | |
| 32 | function 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 | |
| 61 | function syncInboxAutoReadSelection( |
| 62 | input: Omit<UseInboxAutoReadSyncInput, 'workspaceState'> & { |
no test coverage detected