mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Preemptively remove front-end data when removing user emails.
This commit is contained in:
parent
19b57571bf
commit
c630c5d952
2 changed files with 9 additions and 6 deletions
|
@ -59,13 +59,13 @@ form.row(
|
|||
a(
|
||||
href
|
||||
ng-if="!userEmail.default"
|
||||
ng-click="setDefaultUserEmail(userEmail.email)"
|
||||
ng-click="setDefaultUserEmail(userEmail)"
|
||||
) Make default
|
||||
br
|
||||
a(
|
||||
href
|
||||
ng-if="!userEmail.default"
|
||||
ng-click="removeUserEmail(userEmail.email)"
|
||||
ng-click="removeUserEmail(userEmail)"
|
||||
) Remove
|
||||
tr.affiliations-table-highlighted-row(
|
||||
ng-if="ui.isLoadingEmails"
|
||||
|
|
|
@ -97,16 +97,19 @@ define [
|
|||
_reset()
|
||||
_getUserEmails()
|
||||
|
||||
$scope.setDefaultUserEmail = (email) ->
|
||||
$scope.setDefaultUserEmail = (userEmail) ->
|
||||
$scope.ui.isLoadingEmails = true
|
||||
UserAffiliationsDataService
|
||||
.setDefaultUserEmail email
|
||||
.setDefaultUserEmail userEmail.email
|
||||
.then () -> _getUserEmails()
|
||||
|
||||
$scope.removeUserEmail = (email) ->
|
||||
$scope.removeUserEmail = (userEmail) ->
|
||||
$scope.ui.isLoadingEmails = true
|
||||
userEmailIdx = _.indexOf $scope.userEmails, userEmail
|
||||
if userEmailIdx > -1
|
||||
$scope.userEmails.splice userEmailIdx, 1
|
||||
UserAffiliationsDataService
|
||||
.removeUserEmail email
|
||||
.removeUserEmail userEmail.email
|
||||
.then () -> _getUserEmails()
|
||||
|
||||
_reset = () ->
|
||||
|
|
Loading…
Reference in a new issue