Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

chore(config,known-domains) remove legacy code

Saúl Ibarra Corretgé123ab32e75eb
diff --git a/react/features/base/config/middleware.js b/react/features/base/config/middleware.js
index 088ee48cda..ea2aa0c203 100644
--- a/react/features/base/config/middleware.js
+++ b/react/features/base/config/middleware.js
@@ -1,17 +1,9 @@
-// @flow
-
-import { jitsiLocalStorage } from '@jitsi/js-utils';
-
-import { APP_WILL_MOUNT } from '../app';
import { getFeatureFlag } from '../flags/functions';
-import { addKnownDomains } from '../known-domains';
import { MiddlewareRegistry } from '../redux';
import { updateSettings } from '../settings';
-import { parseURIString } from '../util';
import { SET_CONFIG, OVERWRITE_CONFIG } from './actionTypes';
import { updateConfig } from './actions';
-import { _CONFIG_STORE_PREFIX } from './constants';
/**
* The middleware of the feature {@code base/config}.
@@ -22,9 +14,6 @@ import { _CONFIG_STORE_PREFIX } from './constants';
*/
MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
- case APP_WILL_MOUNT:
- return _appWillMount(store, next, action);
-
case SET_CONFIG:
return _setConfig(store, next, action);
@@ -35,56 +24,6 @@ MiddlewareRegistry.register(store => next => action => {
return next(action);
});
-/**
- * Notifies the feature {@code base/config} that the {@link APP_WILL_MOUNT}
- * redux action is being {@code dispatch}ed in a specific redux store.
- *
- * @param {Store} store - The redux store in which the specified {@code action}
- * is being dispatched.
- * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
- * specified {@code action} in the specified {@code store}.
- * @param {Action} action - The redux action which is being {@code dispatch}ed
- * in the specified {@code store}.
- * @private
- * @returns {*} The return value of {@code next(action)}.
- */
-function _appWillMount(store, next, action) {
- const result = next(action);
-
- // It's an opportune time to transfer the feature base/config's knowledge
- // about "known domains" (which is local to the feature) to the feature
- // base/known-domains (which is global to the app).
- //
- // XXX Since the feature base/config predates the feature calendar-sync and,
- // consequently, the feature known-domains, it's possible for the feature
- // base/config to know of domains which the feature known-domains is yet to
- // discover.
-
- const prefix = `${_CONFIG_STORE_PREFIX}/`;
- const knownDomains = [];
-
- for (let i = 0; /* localStorage.key(i) */; ++i) {
- const key = jitsiLocalStorage.key(i);
-
- if (key) {
- let baseURL;
-
- if (key.startsWith(prefix)
- && (baseURL = key.substring(prefix.length))) {
- const uri = parseURIString(baseURL);
- let host;
-
- uri && (host = uri.host) && knownDomains.push(host);
- }
- } else {
- break;
- }
- }
- knownDomains.length && store.dispatch(addKnownDomains(knownDomains));
-
- return result;
-}
-
/**
* Notifies the feature {@code base/config} that the {@link SET_CONFIG} redux
* action is being {@code dispatch}ed in a specific redux store.
diff --git a/react/features/base/known-domains/reducer.ts b/react/features/base/known-domains/reducer.ts
index d20c51733f..cdc2dd17fc 100644
--- a/react/features/base/known-domains/reducer.ts
+++ b/react/features/base/known-domains/reducer.ts
@@ -1,4 +1,3 @@
-import { APP_WILL_MOUNT } from '../app/actionTypes';
import PersistenceRegistry from '../redux/PersistenceRegistry';
import ReducerRegistry from '../redux/ReducerRegistry';
@@ -29,11 +28,6 @@ ReducerRegistry.register(STORE_NAME, (state: Array<string> = DEFAULT_STATE, acti
switch (action.type) {
case ADD_KNOWN_DOMAINS:
return _addKnownDomains(state, action.knownDomains);
-
- case APP_WILL_MOUNT:
- // In case persistence has deserialized a weird redux state:
- return _addKnownDomains(state, DEFAULT_STATE);
-
default:
return state;
}