(conn: { instance: string; database: string })
| 218 | // `selectedIdByConnRef`. |
| 219 | useEffect(() => { |
| 220 | const selectFor = (conn: { instance: string; database: string }) => { |
| 221 | const ck = `${conn.instance}/${conn.database}`; |
| 222 | const list = conversationListByConnection( |
| 223 | useConversationStore.getState(), |
| 224 | conn |
| 225 | ); |
| 226 | const selId = selectedIdByConnRef.current[ck]; |
| 227 | const explicit = selId ? list.find((c) => c.id === selId) : undefined; |
| 228 | return { ck, list, selected: explicit ?? last(list) }; |
| 229 | }; |
| 230 | |
| 231 | const offNewConversation = events.on( |
| 232 | "new-conversation", |
no test coverage detected