(messageId, updates)
| 128 | return updatedChat; |
| 129 | }; |
| 130 | const updateMessage = (messageId, updates) => { |
| 131 | setChats((prev) => |
| 132 | prev.map((chat) => { |
| 133 | if (chat.id === activeChatId) { |
| 134 | return { |
| 135 | ...chat, |
| 136 | messages: chat.messages.map((msg) => |
| 137 | msg.id === messageId ? { ...msg, ...updates } : msg, |
| 138 | ), |
| 139 | }; |
| 140 | } |
| 141 | return chat; |
| 142 | }), |
| 143 | ); |
| 144 | }; |
| 145 | |
| 146 | const removeLastMessage = () => { |
| 147 | setChats((prev) => |
no outgoing calls
no test coverage detected