mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
Fixed bug where we were not submitting multiple emails when users had multiple registered for lbry inc.
This commit is contained in:
parent
22e4fa6aeb
commit
954b8d3454
1 changed files with 10 additions and 10 deletions
|
@ -20,24 +20,24 @@ lbry.emailSettingsForm = function (formSelector, tags, userAuthToken) {
|
|||
hasError = false;
|
||||
isEmailSubmitPending = true;
|
||||
isTagSubmitPending = true;
|
||||
|
||||
var promiseMap = $.map(emailSection.find("input"), function(element) {
|
||||
var url = 'https://api.lbry.io/user/email/edit?auth_token=' + userAuthToken
|
||||
$.param($.map(emailSection.find("input"), function(element) {
|
||||
url = url + "&email="+element.value+"&enabled="+element.checked.toString();
|
||||
fetch(url).then(function(value) { return value.json()}).then(jsonResponse => {
|
||||
return fetch(url).then(function(value) { return value.json()})
|
||||
|
||||
});
|
||||
//Call api for each email a user will have linked - polyfill needed for IE for Promise.all
|
||||
Promise.all(promiseMap)
|
||||
.then(function(apiValues) {
|
||||
isEmailSubmitPending = false;
|
||||
if (!jsonResponse.success){
|
||||
hasError = true
|
||||
emailSection.find('.notice-error').html(jsonResponse.error).show();
|
||||
}
|
||||
showSuccess();
|
||||
}).catch(function(value) {
|
||||
})
|
||||
.catch(function(value) {
|
||||
isEmailSubmitPending = false;
|
||||
hasError = true;
|
||||
var error = "get actual error message from value";
|
||||
emailSection.find('.notice-error').html(error).show();
|
||||
});
|
||||
}));
|
||||
|
||||
//do tag edit
|
||||
var url = 'https://api.lbry.io/user/tag/edit?auth_token=' + userAuthToken
|
||||
|
|
Loading…
Add table
Reference in a new issue