mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-14 15:43:28 +00:00
Merge pull request #1912 from overleaf/ta-invite-404
Better Handling of Invites not Found GitOrigin-RevId: 6fddd1dca772bb4b5108fef433044720fb78c4e9
This commit is contained in:
parent
e029616ed4
commit
c86910a5ef
1 changed files with 12 additions and 5 deletions
|
@ -47,13 +47,20 @@ define(['base'], function(App) {
|
|||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(function() {
|
||||
$scope.notification.inflight = false
|
||||
return ($scope.notification.accepted = true)
|
||||
.then(() => {
|
||||
$scope.notification.accepted = true
|
||||
})
|
||||
.catch(function() {
|
||||
.catch(({ status }) => {
|
||||
if (status === 404) {
|
||||
// 404 probably means the invite has already been accepted and
|
||||
// deleted. Treat as success
|
||||
$scope.notification.accepted = true
|
||||
} else {
|
||||
$scope.notification.error = true
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
$scope.notification.inflight = false
|
||||
return ($scope.notification.error = true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue