mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Display message when user wants to choose existing username (Fixes: #16)
This commit is contained in:
parent
4dc0ec07b8
commit
69fbd31abc
3 changed files with 14 additions and 4 deletions
|
|
@ -26,11 +26,18 @@ Template.editProfilePopup.events({
|
|||
'profile.fullname': fullname,
|
||||
'profile.initials': initials,
|
||||
}});
|
||||
// XXX We should report the error to the user.
|
||||
|
||||
if (username !== Meteor.user().username) {
|
||||
Meteor.call('setUsername', username);
|
||||
}
|
||||
Popup.back();
|
||||
Meteor.call('setUsername', username, function(error) {
|
||||
const messageElement = tpl.$('.username-taken');
|
||||
if (error) {
|
||||
messageElement.show();
|
||||
} else {
|
||||
messageElement.hide();
|
||||
Popup.back();
|
||||
}
|
||||
});
|
||||
} else Popup.back();
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue