fix: if no group label is selected, select no group title option

dont save groupTitle: "['null']" if nothing is selected
isekai-main
Barış Soner Uşaklı 3 years ago
parent 05e2b3541b
commit 94da502629

@ -25,6 +25,10 @@ define('forum/account/edit', [
});
});
if (ajaxify.data.groupTitleArray.length === 1 && ajaxify.data.groupTitleArray[0] === '') {
$('#groupTitle option[value=""]').attr('selected', true);
}
handleImageChange();
handleAccountDelete();
handleEmailConfirm();
@ -36,6 +40,7 @@ define('forum/account/edit', [
function updateProfile() {
const userData = $('form[component="profile/edit/form"]').serializeObject();
userData.uid = ajaxify.data.uid;
userData.groupTitle = userData.groupTitle || '';
userData.groupTitle = JSON.stringify(
Array.isArray(userData.groupTitle) ? userData.groupTitle : [userData.groupTitle]
);

Loading…
Cancel
Save