From 3e6c988c309a1448c0b54533ba632417d09fda73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 12 Jul 2022 16:59:06 +0200 Subject: [PATCH] chore(redux) remove legacy compatibility code --- .../base/redux/PersistenceRegistry.ts | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/react/features/base/redux/PersistenceRegistry.ts b/react/features/base/redux/PersistenceRegistry.ts index 75b55e674..2eef59ed3 100644 --- a/react/features/base/redux/PersistenceRegistry.ts +++ b/react/features/base/redux/PersistenceRegistry.ts @@ -11,11 +11,6 @@ import logger from './logger'; declare let __DEV__: any; -/** - * The name of the {@code localStorage} store where the app persists its values. - */ -const PERSISTED_STATE_NAME = 'jitsi-state'; - /** * Mixed type of the element (subtree) config. If it's a {@code boolean} (and is * {@code true}), we persist the entire subtree. If it's an {@code Object}, we @@ -46,15 +41,12 @@ class PersistenceRegistry { * @returns {Object} */ getPersistedState() { - let filteredPersistedState: any = {}; + const filteredPersistedState: any = {}; // localStorage key per feature for (const subtreeName of Object.keys(this._elements)) { // Assumes that the persisted value is stored under the same key as // the feature's redux state name. - // TODO We'll need to introduce functions later that can control the - // persist key's name. Similar to control serialization and - // deserialization. But that should be a straightforward change. const persistedSubtree = this._getPersistedSubtree( subtreeName, @@ -66,30 +58,6 @@ class PersistenceRegistry { } } - // legacy - if (Object.keys(filteredPersistedState).length === 0) { - let persistedState = jitsiLocalStorage.getItem(PERSISTED_STATE_NAME); - - if (persistedState) { - try { - persistedState = Bourne.parse(persistedState); - } catch (error) { - logger.error( - 'Error parsing persisted state', - persistedState, - error); - persistedState = {}; - } - - filteredPersistedState = this._getFilteredState(persistedState); - - // Store into the new format and delete the old format so that - // it's not used again. - this.persistState(filteredPersistedState); - jitsiLocalStorage.removeItem(PERSISTED_STATE_NAME); - } - } - // Initialize the checksum. this._checksum = this._calculateChecksum(filteredPersistedState);