({
state: newState,
title: newTitle,
}: {
state?: ThreadState;
title?: string;
})
| 75 | }; |
| 76 | |
| 77 | const updateThread = ({ |
| 78 | state: newState, |
| 79 | title: newTitle, |
| 80 | }: { |
| 81 | state?: ThreadState; |
| 82 | title?: string; |
| 83 | }) => { |
| 84 | const options = { |
| 85 | state: newState || thread.state, |
| 86 | title: newTitle || thread.title || undefined, |
| 87 | }; |
| 88 | setThread((thread: SerializedThread) => { |
| 89 | return { |
| 90 | ...thread, |
| 91 | ...options, |
| 92 | }; |
| 93 | }); |
| 94 | return api |
| 95 | .updateThread({ |
| 96 | accountId: settings.communityId, |
| 97 | id: thread.id, |
| 98 | ...options, |
| 99 | }) |
| 100 | .catch((_) => { |
| 101 | Toast.error('Failed to close the thread.'); |
| 102 | }); |
| 103 | }; |
| 104 | |
| 105 | const editMessage = ({ id, body }: { id: string; body: string }) => { |
| 106 | setThread((thread: SerializedThread) => { |
no test coverage detected