FIX: Correctly format select options for group poll by fields ()

This commit is contained in:
Mark VanLandingham 2020-03-06 12:58:59 -06:00 committed by GitHub
parent f2b95c1918
commit 763a065df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
plugins/poll/assets/javascripts/widgets

View File

@ -454,7 +454,9 @@ createWidget("discourse-poll-info", {
function transformUserFieldToLabel(fieldName) {
let transformed = fieldName.split("_").filter(Boolean);
transformed[0] = classify(transformed[0]);
if (transformed.length > 1) {
transformed[0] = classify(transformed[0]);
}
return transformed.join(" ");
}