()
| 40 | } |
| 41 | |
| 42 | export function destroySections() { |
| 43 | // Flush any pending debounced save before clearing state so switching tracks |
| 44 | // never drops unsaved sections. _save() serializes _sections synchronously |
| 45 | // (JSON.stringify runs before the first await) so it's safe to clear state |
| 46 | // after calling it. |
| 47 | if (_saveTimer !== null) { |
| 48 | clearTimeout(_saveTimer); |
| 49 | _saveTimer = null; |
| 50 | _save(); |
| 51 | } |
| 52 | _hideSaveIndicator(); |
| 53 | _trackId = null; |
| 54 | _sections = []; |
| 55 | _duration = 0; |
| 56 | if (_container) _container.innerHTML = ""; |
| 57 | _container = null; |
| 58 | } |
| 59 | |
| 60 | // ─── Rendering ──────────────────────────────────────────── |
| 61 |
no test coverage detected