fix: clear sort tag fields synchronously before async fill

Sort tag fields were not reset when opening a new song's edit modal,
so values from the previously opened song persisted until the async
romaji index fetch completed (or indefinitely if it found no entry).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-27 00:40:16 +02:00
1 parent fb605b0b31
commit e6d85e63a8
1 file changed
+6
+6
View File
@@ -352,6 +352,12 @@ export function toggleInfoEdit() {
document.getElementById('ie-disc').value = s.discNumber || '';
document.getElementById('ie-totaltracks').value = s.albumSongCount || '';
// Clear sort fields immediately so stale values from a previously opened song don't show
document.getElementById('ie-titlesort').value = '';
document.getElementById('ie-artistsort').value = '';
document.getElementById('ie-albumartistsort').value = '';
document.getElementById('ie-albumsort').value = '';
// Sort tags: fetch romaji index on demand (cached if already loaded), then overwrite with
// actual file tags from backend. This works regardless of the showRomaji toggle.
const _sId = s.id;