()
| 574 | +invalidatedThreads: $ReadOnlyArray<string>, |
| 575 | }; |
| 576 | function useLeaveThread(): ( |
| 577 | input: UseLeaveThreadInput, |
| 578 | ) => Promise<LeaveThreadResult> { |
| 579 | const processAndSendDMOperation = useProcessAndSendDMOperation(); |
| 580 | const viewerID = useSelector( |
| 581 | state => state.currentUserInfo && state.currentUserInfo.id, |
| 582 | ); |
| 583 | const keyserverLeaveThread = useKeyserverCall(leaveThread); |
| 584 | const dispatchActionPromise = useDispatchActionPromise(); |
| 585 | const modifyFarcasterMembership = useModifyFarcasterMembershipInput(); |
| 586 | const auxUserStore = useSelector(state => state.auxUserStore); |
| 587 | |
| 588 | return React.useCallback( |
| 589 | (input: UseLeaveThreadInput) => |
| 590 | threadSpecs[input.threadInfo.type].protocol().leaveThread( |
| 591 | { threadInfo: input.threadInfo, viewerID }, |
| 592 | { |
| 593 | processAndSendDMOperation, |
| 594 | keyserverLeaveThread, |
| 595 | dispatchActionPromise, |
| 596 | modifyFarcasterMembership, |
| 597 | auxUserStore, |
| 598 | }, |
| 599 | ), |
| 600 | [ |
| 601 | auxUserStore, |
| 602 | dispatchActionPromise, |
| 603 | keyserverLeaveThread, |
| 604 | modifyFarcasterMembership, |
| 605 | processAndSendDMOperation, |
| 606 | viewerID, |
| 607 | ], |
| 608 | ); |
| 609 | } |
| 610 | |
| 611 | const fetchThreadMedia = |
| 612 | ( |
no test coverage detected