diff --git a/public/js/Room.js b/public/js/Room.js index a7ac9127..dd53e008 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -2143,7 +2143,7 @@ function handleRoomClientEvents() { if (survey && survey.enabled) { leaveFeedback(); } else { - redirect && redirect.enabled ? openURL(redirect.url) : openURL('/newroom'); + redirectOnLeave(); } }); } @@ -2169,11 +2169,15 @@ function leaveFeedback() { if (result.isConfirmed) { openURL(survey.url); } else { - openURL('/newroom'); + redirectOnLeave(); } }); } +function redirectOnLeave() { + redirect && redirect.enabled ? openURL(redirect.url) : openURL('/newroom'); +} + function userLog(icon, message, position, timer = 3000) { const Toast = Swal.mixin({ background: swalBackground,