1.1 KiB
1.1 KiB
Song Tile State Fix
Problem Identified
Song tiles were not returning to normal state after download completion because the code was using document.activeElement instead of the actual clicked element.
Root Cause
convertVideo()method useddocument.activeElementto get the element to styledocument.activeElementmight not be the correct song tile, especially during async operations- The
finallyblock tried to removetg-list-item--convertingclass from wrong element
Solution Implemented
- Replaced
document.activeElementwithdocument.querySelector(\[onclick*="${videoId}"]`)` - This finds the specific song tile that contains the videoId in its onclick attribute
- Ensures the correct element gets the converting state and has it properly removed
Code Location
- File:
public/script.ts - Method:
convertVideo()around line 212-218 - Changed element selection logic to target the correct clicked song tile
Result
Song tiles now properly return to normal state after download/conversion completes (both success and error cases).