Fix guest state sync

This commit is contained in:
Shane Kilkelly 2017-10-27 14:41:48 +01:00
parent 83bd78f467
commit a57827458d
2 changed files with 7 additions and 3 deletions

View file

@ -101,7 +101,7 @@
review-panel-toggle(
ng-model="reviewPanel.trackChangesOnForGuests"
on-toggle="toggleTrackChangesForGuests(isOn);"
disabled="!project.features.trackChanges || !permissions.write || !trackChangesForGuestsAvailable"
disabled="!project.features.trackChanges || !permissions.write || !reviewPanel.trackChangesForGuestsAvailable"
)
.rp-entry-list(

View file

@ -82,8 +82,8 @@ define [
$scope.$watch 'project.publicAccesLevel', (level) ->
if level?
available = $scope.trackChangesForGuestsAvailable = level == 'tokenBased'
if !available
$scope.reviewPanel.trackChangesForGuestsAvailable = level == 'tokenBased'
if !$scope.reviewPanel.trackChangesForGuestsAvailable
$scope.trackChangesOnForThisGuestClient = false
$scope.toggleTrackChangesForGuests false
@ -638,6 +638,10 @@ define [
)
$scope.trackChangesOnForThisGuestClient = newValue
_setUserTCState(ide.$scope.user.id, newValue, isLocal)
else
$scope.reviewPanel.trackChangesOnForGuests = false
$scope.trackChangesOnForThisGuestClient = false
_setUserTCState(ide.$scope.user.id, false, isLocal)
applyClientTrackChangesStateToServer = () ->
data = {}