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:
1 parent
fb605b0b31
commit
e6d85e63a8
1 file changed
+6
@@ -352,6 +352,12 @@ export function toggleInfoEdit() {
|
|||||||
document.getElementById('ie-disc').value = s.discNumber || '';
|
document.getElementById('ie-disc').value = s.discNumber || '';
|
||||||
document.getElementById('ie-totaltracks').value = s.albumSongCount || '';
|
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
|
// 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.
|
// actual file tags from backend. This works regardless of the showRomaji toggle.
|
||||||
const _sId = s.id;
|
const _sId = s.id;
|
||||||
|
|||||||
Reference in new issue
Block a user