Fixed removing users always logging out
This commit is contained in:
parent
b3def7fc21
commit
ebd25cd9a9
1 changed files with 3 additions and 1 deletions
|
@ -58,7 +58,9 @@ App.Presenters.UserAccountRemovalPresenter = function(
|
||||||
}
|
}
|
||||||
promise.wait(api.delete('/users/' + user.name))
|
promise.wait(api.delete('/users/' + user.name))
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
if (user.name === auth.getCurrentUser().name) {
|
||||||
auth.logout();
|
auth.logout();
|
||||||
|
}
|
||||||
var $messageDiv = messagePresenter.showInfo($messages, 'Account deleted. <a href="">Back to main page</a>');
|
var $messageDiv = messagePresenter.showInfo($messages, 'Account deleted. <a href="">Back to main page</a>');
|
||||||
$messageDiv.find('a').click(mainPageLinkClicked);
|
$messageDiv.find('a').click(mainPageLinkClicked);
|
||||||
}).fail(function(response) {
|
}).fail(function(response) {
|
||||||
|
|
Reference in a new issue