Remove trailing coma in promptMatrix when activeTags is empty

This commit is contained in:
Marc-Andre Ferland 2022-10-13 00:45:29 -04:00
parent 8cb408bc6e
commit 5ba1ae9ae4

View File

@ -878,7 +878,10 @@ function getPrompts() {
promptsToMake = promptsToMake.concat(promptPermutations)
}
})
const promptTags = (activeTags.length > 0 ? activeTags.map(x => x.name).join(", ") : "")
if (activeTags.length <= 0) {
return promptsToMake
}
const promptTags = activeTags.map(x => x.name).join(", ")
return promptsToMake.map((prompt) => `${prompt}, ${promptTags}`)
}