diff options
author | Mario Orlicky <orlickymario@gmail.com> | 2016-11-18 23:18:16 +0100 |
---|---|---|
committer | Mario Orlicky <orlickymario@gmail.com> | 2016-11-18 23:18:16 +0100 |
commit | 69fbd31abc5772f7d092caf501e536e88cdc0e2d (patch) | |
tree | 0e295778be57acc6dbfa5f90d3442e199ccc63c4 /client/components/users/userHeader.js | |
parent | 4dc0ec07b8560d0814ed5cb72b2cac93722bb93c (diff) | |
download | wekan-69fbd31abc5772f7d092caf501e536e88cdc0e2d.tar.gz wekan-69fbd31abc5772f7d092caf501e536e88cdc0e2d.tar.bz2 wekan-69fbd31abc5772f7d092caf501e536e88cdc0e2d.zip |
Display message when user wants to choose existing username (Fixes: #16)
Diffstat (limited to 'client/components/users/userHeader.js')
-rw-r--r-- | client/components/users/userHeader.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 10fdf699..e060c13a 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -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(); }, }); |