From a270e4300a3fdf434db85c5d1c231e13a69133da Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Thu, 8 Oct 2020 12:41:00 +0300 Subject: [PATCH] fix(native) add missing function --- react/features/conference/functions.any.js | 20 +++++++++++++++ react/features/conference/functions.native.js | 1 + react/features/conference/functions.web.js | 25 +++---------------- 3 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 react/features/conference/functions.any.js diff --git a/react/features/conference/functions.any.js b/react/features/conference/functions.any.js new file mode 100644 index 000000000..ece236f31 --- /dev/null +++ b/react/features/conference/functions.any.js @@ -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; +} diff --git a/react/features/conference/functions.native.js b/react/features/conference/functions.native.js index e69de29bb..fb2a6bc39 100644 --- a/react/features/conference/functions.native.js +++ b/react/features/conference/functions.native.js @@ -0,0 +1 @@ +export * from './functions.any'; diff --git a/react/features/conference/functions.web.js b/react/features/conference/functions.web.js index 25e3ee45a..bac1fb2eb 100644 --- a/react/features/conference/functions.web.js +++ b/react/features/conference/functions.web.js @@ -4,13 +4,11 @@ import { translateToHTML } from '../base/i18n'; import { getLocalParticipant } from '../base/participants'; import { toState } from '../base/redux'; import { getBackendSafePath, getJitsiMeetGlobalNS } from '../base/util'; -import { - areThereNotifications, - showWarningNotification -} from '../notifications'; -import { getOverlayToRender } from '../overlay'; +import { showWarningNotification } from '../notifications'; import { createRnnoiseProcessorPromise } from '../rnnoise'; +export * from './functions.any'; + /** * Returns the result of getWiFiStats from the global NS or does nothing (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. *