(topic: SerializedTopic)
| 203 | |
| 204 | useEffect(() => { |
| 205 | const callback = (topic: SerializedTopic) => { |
| 206 | selectThread(topic.threadId, false); |
| 207 | |
| 208 | const node = document.getElementById( |
| 209 | `channel-grid-item-${topic.messageId}` |
| 210 | ); |
| 211 | |
| 212 | const layout = document.getElementById('sidebar-layout-left'); |
| 213 | const footer = document.getElementById('chat-layout-footer'); |
| 214 | if (node && layout && footer) { |
| 215 | node.scrollIntoView({ block: 'end' }); |
| 216 | const offset = footer.clientHeight; |
| 217 | layout.scrollTop = layout.scrollTop + offset; |
| 218 | } |
| 219 | }; |
| 220 | |
| 221 | EventEmitter.on('navbar:topic:clicked', callback); |
| 222 |
no test coverage detected