(cell: CellType | GenerateAICellType)
| 160 | }); |
| 161 | |
| 162 | async function onDeleteCell(cell: CellType | GenerateAICellType) { |
| 163 | if (!channel) { |
| 164 | return; |
| 165 | } |
| 166 | if (cell.type !== 'code' && cell.type !== 'markdown') { |
| 167 | throw new Error(`Cannot delete cell of type '${cell.type}'`); |
| 168 | } |
| 169 | |
| 170 | // Optimistically delete cell |
| 171 | removeCell(cell); |
| 172 | |
| 173 | channel.push('cell:delete', { |
| 174 | cellId: cell.id, |
| 175 | }); |
| 176 | } |
| 177 | |
| 178 | useEffect(() => { |
| 179 | if (!channel) { |
no test coverage detected