notifications,presence-status: check if interfaceConfig is declared

Protectt ourselves against interfaceConfig being undeclared. typeof
interfaceConfig will return "undefined", but that's different than having some
window.interfaceConfig = undefined, even though the valus is the same. The
former will give a ReferenceError.
pull/5035/head jitsi-meet_4208
Saúl Ibarra Corretgé 5 years ago committed by Saúl Ibarra Corretgé
parent 306c8ba8c2
commit bd5901d59c
  1. 2
      react/features/notifications/functions.js
  2. 2
      react/features/presence-status/functions.js

@ -24,5 +24,5 @@ export function areThereNotifications(stateful: Object | Function) {
* @returns {boolean}
*/
export function joinLeaveNotificationsDisabled() {
return Boolean(interfaceConfig?.DISABLE_JOIN_LEAVE_NOTIFICATIONS);
return Boolean(typeof interfaceConfig !== 'undefined' && interfaceConfig?.DISABLE_JOIN_LEAVE_NOTIFICATIONS);
}

@ -8,5 +8,5 @@ declare var interfaceConfig: Object;
* @returns {boolean}
*/
export function presenceStatusDisabled() {
return Boolean(interfaceConfig?.DISABLE_PRESENCE_STATUS);
return Boolean(typeof interfaceConfig !== 'undefined' && interfaceConfig?.DISABLE_PRESENCE_STATUS);
}

Loading…
Cancel
Save