fix(native) add missing function

This commit is contained in:
Tudor-Ovidiu Avram 2020-10-08 12:41:00 +03:00 committed by Saúl Ibarra Corretgé
parent 5e2ee3bdcd
commit a270e4300a
3 changed files with 24 additions and 22 deletions

View File

@ -0,0 +1,20 @@
import { toState } from '../base/redux';
import { areThereNotifications } from '../notifications';
import { getOverlayToRender } from '../overlay';
/**
* Tells whether or not the notifications should be displayed within
* the conference feature based on the current Redux state.
*
* @param {Object|Function} stateful - The redux store state.
* @returns {boolean}
*/
export function shouldDisplayNotifications(stateful) {
const state = toState(stateful);
const isAnyOverlayVisible = Boolean(getOverlayToRender(state));
const { calleeInfoVisible } = state['features/invite'];
return areThereNotifications(state)
&& !isAnyOverlayVisible
&& !calleeInfoVisible;
}

View File

@ -0,0 +1 @@
export * from './functions.any';

View File

@ -4,13 +4,11 @@ import { translateToHTML } from '../base/i18n';
import { getLocalParticipant } from '../base/participants'; import { getLocalParticipant } from '../base/participants';
import { toState } from '../base/redux'; import { toState } from '../base/redux';
import { getBackendSafePath, getJitsiMeetGlobalNS } from '../base/util'; import { getBackendSafePath, getJitsiMeetGlobalNS } from '../base/util';
import { import { showWarningNotification } from '../notifications';
areThereNotifications,
showWarningNotification
} from '../notifications';
import { getOverlayToRender } from '../overlay';
import { createRnnoiseProcessorPromise } from '../rnnoise'; import { createRnnoiseProcessorPromise } from '../rnnoise';
export * from './functions.any';
/** /**
* Returns the result of getWiFiStats from the global NS or does nothing * Returns the result of getWiFiStats from the global NS or does nothing
(returns empty result). (returns empty result).
@ -52,23 +50,6 @@ export function maybeShowSuboptimalExperienceNotification(dispatch, t) {
} }
} }
/**
* Tells whether or not the notifications should be displayed within
* the conference feature based on the current Redux state.
*
* @param {Object|Function} stateful - The redux store state.
* @returns {boolean}
*/
export function shouldDisplayNotifications(stateful) {
const state = toState(stateful);
const isAnyOverlayVisible = Boolean(getOverlayToRender(state));
const { calleeInfoVisible } = state['features/invite'];
return areThereNotifications(state)
&& !isAnyOverlayVisible
&& !calleeInfoVisible;
}
/** /**
* Returns an object aggregating the conference options. * Returns an object aggregating the conference options.
* *