Browse Source

fix(desktop): remove page reload on session/signaling issues

Signed-off-by: Grigorii Shartsev <grigorii.shartsev@nextcloud.com>
pull/9050/head
Grigorii Shartsev 3 years ago
parent
commit
deec41ecab
  1. 22
      src/mixins/sessionIssueHandler.js
  2. 14
      src/utils/signaling.js

22
src/mixins/sessionIssueHandler.js

@ -48,21 +48,27 @@ const sessionIssueHandler = {
SessionStorage.removeItem('joined_conversation')
// Need to delay until next tick, otherwise the PreventUnload is still being triggered
// Putting the window in front with the warning and irritating the user
this.$nextTick(() => {
// FIXME: can't use router push as it somehow doesn't clean up
// fully and leads the other instance where "Join here" was clicked
// to redirect to "not found"
window.location = url
})
if (!IS_DESKTOP) {
this.$nextTick(() => {
// FIXME: can't use router push as it somehow doesn't clean up
// fully and leads the other instance where "Join here" was clicked
// to redirect to "not found"
window.location = generateUrl(url)
})
} else {
// TODO: DESKTOP: to not hard-code the address?
window.location = `/talk_window/#${url}`
}
},
duplicateSessionTriggered() {
this.redirectTo(generateUrl('/apps/spreed/duplicate-session'))
// TODO: DESKTOP: should close the duplicated window instead of redirect
this.redirectTo('/apps/spreed/duplicate-session')
},
deletedSessionTriggered() {
// workaround: force page refresh to kill stray WebRTC connections
this.redirectTo(generateUrl('/apps/spreed/not-found'))
this.redirectTo('/apps/spreed/not-found')
},
},
}

14
src/utils/signaling.js

@ -282,10 +282,16 @@ Signaling.Base.prototype.joinCall = function(token, flags, silent) {
}.bind(this))
.catch(function() {
reject(new Error())
// Server maintenance, lobby kicked in, or room not found.
// We first redirect to the conversation again and that
// will then show the proper error message to the user.
window.location = generateUrl('call/' + token)
if (!IS_DESKTOP) {
// Server maintenance, lobby kicked in, or room not found.
// We first redirect to the conversation again and that
// will then show the proper error message to the user.
window.location = generateUrl('call/' + token)
} else {
// TODO: Is it true, reload is equal to generateUrl('call/' + token) here?
// Or can we always just reload the page?
window.location.reload()
}
})
})
}

Loading…
Cancel
Save