diff --git a/bigbluebutton-html5/imports/startup/client/auth.js b/bigbluebutton-html5/imports/startup/client/auth.js index 77337bcc2c4933729cac40c612690d345c3d3319..238ac993f4643e337cbb5ea4bb377e004261fa5a 100755 --- a/bigbluebutton-html5/imports/startup/client/auth.js +++ b/bigbluebutton-html5/imports/startup/client/auth.js @@ -1,6 +1,7 @@ import Auth from '/imports/ui/services/auth'; import { setCustomLogoUrl } from '/imports/ui/components/user-list/service'; import { log } from '/imports/ui/services/api'; +import deviceType from '/imports/utils/deviceType'; // disconnected and trying to open a new connection const STATUS_CONNECTING = 'connecting'; @@ -27,19 +28,10 @@ export function joinRouteHandler(nextState, replace, callback) { Auth.set(meetingID, internalUserID, authToken, logoutUrl, sessionToken); - let path = '/'; - - const MAX_PHONE_SHORT_SIDE = 480; - - const smallSide = window.screen.width < window.screen.height - ? window.screen.width - : window.screen.height; - - const isPhone = smallSide <= MAX_PHONE_SHORT_SIDE; - - if (!isPhone) path += 'users'; + const path = deviceType().isPhone ? '/' : '/users'; replace({ pathname: path }); + callback(); }); } diff --git a/bigbluebutton-html5/imports/utils/deviceType.js b/bigbluebutton-html5/imports/utils/deviceType.js new file mode 100644 index 0000000000000000000000000000000000000000..f210ed04fd773ae92a29d078d0da35055b660b95 --- /dev/null +++ b/bigbluebutton-html5/imports/utils/deviceType.js @@ -0,0 +1,14 @@ +const deviceType = () => { + const MAX_PHONE_SHORT_SIDE = 480; + + const smallSide = window.screen.width < window.screen.height + ? window.screen.width + : window.screen.height; + + return { + isPhone: smallSide <= MAX_PHONE_SHORT_SIDE, + }; +}; + +export default deviceType; +