Skip to content

Commit

Permalink
Fix generation for form data
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Dec 30, 2024
1 parent 2009291 commit edbef2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/main/song.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ export function spawnSongNode(json, curr, id, isMinimalist) {
}

if (editName.value === "") { // User removed the name
namePlaceholder = crypto.randomUUID();
namePlaceholder = "(autogenerated)";
}
}
else
{
haveChanges = editName.value !== "" || editUrl.value !== "";

if (editUrl.value !== "" && editName.value === "") { // Used added a URL but name is still empty
namePlaceholder = crypto.randomUUID();
namePlaceholder = "(autogenerated)";
}
}
if (editKey.value !== "" && editKey.value !== curr.album) haveChanges = true;
Expand All @@ -92,7 +92,7 @@ export function spawnSongNode(json, curr, id, isMinimalist) {
} else if (!haveChanges && curr.album) {
key = curr.album;
} else {
key = generateKey(curr.artist, editName.value === "" ? namePlaceholder : editName.value);
key = generateKey(curr.artist, editName.value);
}

editKey.placeholder = key;
Expand Down

0 comments on commit edbef2b

Please sign in to comment.