mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
chore(appState): default empty string state does not check conditions (#15240)
* feat(mobile/background): force appState status when the app mounts
This commit is contained in:
@@ -24,6 +24,19 @@ MiddlewareRegistry.register(store => next => action => {
|
||||
const { dispatch } = store;
|
||||
|
||||
_setAppStateListener(store, _onAppStateChange.bind(undefined, dispatch));
|
||||
|
||||
// Because there is no change taking place when the app mounts,
|
||||
// we need to force registering the appState status.
|
||||
const appStateInterval = setInterval(() => {
|
||||
const { currentState } = AppState;
|
||||
|
||||
if (currentState !== 'unknown') {
|
||||
clearInterval(appStateInterval);
|
||||
|
||||
_onAppStateChange(dispatch, currentState);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -47,7 +60,7 @@ MiddlewareRegistry.register(store => next => action => {
|
||||
function _onAppStateChange(dispatch: IStore['dispatch'], appState: string) {
|
||||
dispatch(appStateChanged(appState));
|
||||
|
||||
logger.debug(`appState changed to: ${appState}`);
|
||||
logger.info(`appState changed to: ${appState}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user