fix(iOS-responsive-ui) Attempt fix iOS responsive ui issue (#14819)

- on iOS safari and chrome, in case we show eg a spinner until we get the videoConferenceJoined event, all `clientResize` are done with size 0 for width/height
- on iOS we never get a `clientResize` call with correct values, except if we force a call by eg opening/closing the chat window
This commit is contained in:
Horatiu Muresan
2024-06-11 13:59:11 +03:00
committed by GitHub
parent d0130f9975
commit bebcfa3fd7
2 changed files with 18 additions and 0 deletions

View File

@@ -35,6 +35,10 @@ const REDUCED_UI_THRESHOLD = 300;
*/
export function clientResized(clientWidth: number, clientHeight: number) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
if (!clientWidth && !clientHeight) {
return;
}
let availableWidth = clientWidth;
if (navigator.product !== 'ReactNative') {

View File

@@ -1,5 +1,6 @@
import { IStore } from '../../app/types';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';
import { CONFERENCE_JOINED } from '../conference/actionTypes';
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
import { clientResized } from './actions';
@@ -27,6 +28,19 @@ MiddlewareRegistry.register(store => next => action => {
_appWillMount(store);
break;
case CONFERENCE_JOINED: {
const { clientHeight = 0, clientWidth = 0 } = store.getState()['features/base/responsive-ui'];
if (!clientHeight && !clientWidth) {
const {
innerHeight,
innerWidth
} = window;
store.dispatch(clientResized(innerWidth, innerHeight));
}
break;
}
}
return result;