Przeglądaj źródła

fix(settings) remove legacy compatibility code

master
Saúl Ibarra Corretgé 4 lat temu
rodzic
commit
12877c7fce
1 zmienionych plików z 1 dodań i 57 usunięć
  1. 1
    57
      react/features/base/settings/reducer.js

+ 1
- 57
react/features/base/settings/reducer.js Wyświetl plik

4
 import _ from 'lodash';
4
 import _ from 'lodash';
5
 
5
 
6
 import { APP_WILL_MOUNT } from '../app/actionTypes';
6
 import { APP_WILL_MOUNT } from '../app/actionTypes';
7
-import { browser } from '../lib-jitsi-meet';
8
 import { PersistenceRegistry, ReducerRegistry } from '../redux';
7
 import { PersistenceRegistry, ReducerRegistry } from '../redux';
9
 import { assignIfDefined } from '../util';
8
 import { assignIfDefined } from '../util';
10
 
9
 
11
 import { SETTINGS_UPDATED } from './actionTypes';
10
 import { SETTINGS_UPDATED } from './actionTypes';
12
-import logger from './logger';
13
 
11
 
14
 /**
12
 /**
15
  * The default/initial redux state of the feature {@code base/settings}.
13
  * The default/initial redux state of the feature {@code base/settings}.
75
     return state;
73
     return state;
76
 });
74
 });
77
 
75
 
78
-/**
79
- * Retrieves the legacy profile values regardless of it's being in pre or
80
- * post-flattening format.
81
- *
82
- * FIXME: Let's remove this after a predefined time (e.g. By July 2018) to avoid
83
- * garbage in the source.
84
- *
85
- * @private
86
- * @returns {Object}
87
- */
88
-function _getLegacyProfile() {
89
-    let persistedProfile = jitsiLocalStorage.getItem('features/base/profile');
90
-
91
-    if (persistedProfile) {
92
-        try {
93
-            persistedProfile = JSON.parse(persistedProfile);
94
-
95
-            if (persistedProfile && typeof persistedProfile === 'object') {
96
-                const preFlattenedProfile = persistedProfile.profile;
97
-
98
-                return preFlattenedProfile || persistedProfile;
99
-            }
100
-        } catch (e) {
101
-            logger.warn('Error parsing persisted legacy profile', e);
102
-        }
103
-    }
104
-
105
-    return {};
106
-}
107
-
108
 /**
76
 /**
109
  * Inits the settings object based on what information we have available.
77
  * Inits the settings object based on what information we have available.
110
  * Info taken into consideration:
78
  * Info taken into consideration:
111
- *   - Old Settings.js style data
112
- *   - Things that we stored in profile earlier but belong here.
79
+ *   - Old Settings.js style data.
113
  *
80
  *
114
  * @private
81
  * @private
115
  * @param {Object} featureState - The current state of the feature.
82
  * @param {Object} featureState - The current state of the feature.
138
         email
105
         email
139
     }, settings);
106
     }, settings);
140
 
107
 
141
-    if (!browser.isReactNative()) {
142
-        // Browser only
143
-        const localFlipX = JSON.parse(jitsiLocalStorage.getItem('localFlipX') || 'true');
144
-        const cameraDeviceId = jitsiLocalStorage.getItem('cameraDeviceId') || '';
145
-        const micDeviceId = jitsiLocalStorage.getItem('micDeviceId') || '';
146
-
147
-        // Currently audio output device change is supported only in Chrome and
148
-        // default output always has 'default' device ID
149
-        const audioOutputDeviceId = jitsiLocalStorage.getItem('audioOutputDeviceId') || 'default';
150
-
151
-        settings = assignIfDefined({
152
-            audioOutputDeviceId,
153
-            cameraDeviceId,
154
-            localFlipX,
155
-            micDeviceId
156
-        }, settings);
157
-    }
158
-
159
-    // Things we stored in profile earlier
160
-    const legacyProfile = _getLegacyProfile();
161
-
162
-    settings = assignIfDefined(legacyProfile, settings);
163
-
164
     return settings;
108
     return settings;
165
 }
109
 }

Ładowanie…
Anuluj
Zapisz