* Updates record button UI state * @param {boolean} recording - Whether currently recording
(recording)
| 1345 | * @param {boolean} recording - Whether currently recording |
| 1346 | */ |
| 1347 | function updateRecordButtonUI(recording) { |
| 1348 | isRecording = recording; |
| 1349 | |
| 1350 | if (recording) { |
| 1351 | recordButton.classList.add('recording'); |
| 1352 | const recordIcon = /** @type {HTMLElement|null} */ (recordButton.querySelector('.record-icon')); |
| 1353 | const stopIcon = /** @type {HTMLElement|null} */ (recordButton.querySelector('.stop-icon')); |
| 1354 | if (recordIcon) recordIcon.style.display = 'none'; |
| 1355 | if (stopIcon) stopIcon.style.display = 'block'; |
| 1356 | } else { |
| 1357 | recordButton.classList.remove('recording'); |
| 1358 | const recordIcon = /** @type {HTMLElement|null} */ (recordButton.querySelector('.record-icon')); |
| 1359 | const stopIcon = /** @type {HTMLElement|null} */ (recordButton.querySelector('.stop-icon')); |
| 1360 | if (recordIcon) recordIcon.style.display = 'block'; |
| 1361 | if (stopIcon) stopIcon.style.display = 'none'; |
| 1362 | } |
| 1363 | |
| 1364 | if (window.updateRecordButtonTooltip) { |
| 1365 | window.updateRecordButtonTooltip(); |
| 1366 | } |
| 1367 | } |
| 1368 | |
| 1369 | // Handle record button click |
| 1370 | recordButton.addEventListener('click', async () => { |