Kaynağa Gözat

Flatten the store of the profile feature

master
zbettenbuk 7 yıl önce
ebeveyn
işleme
d02ab2c641

+ 1
- 1
react/features/base/profile/functions.js Dosyayı Görüntüle

@@ -11,5 +11,5 @@
11 11
 export function getProfile(state: Object) {
12 12
     const profileStateSlice = state['features/base/profile'];
13 13
 
14
-    return profileStateSlice ? profileStateSlice.profile || {} : {};
14
+    return profileStateSlice || {};
15 15
 }

+ 3
- 11
react/features/base/profile/reducer.js Dosyayı Görüntüle

@@ -5,26 +5,18 @@ import { PersistenceRegistry } from '../storage';
5 5
 
6 6
 import { PROFILE_UPDATED } from './actionTypes';
7 7
 
8
-const DEFAULT_STATE = {
9
-    profile: {}
10
-};
11
-
12 8
 const STORE_NAME = 'features/base/profile';
13 9
 
14 10
 /**
15 11
  * Sets up the persistence of the feature base/profile.
16 12
  */
17
-PersistenceRegistry.register(STORE_NAME, {
18
-    profile: true
19
-});
13
+PersistenceRegistry.register(STORE_NAME);
20 14
 
21 15
 ReducerRegistry.register(
22
-    STORE_NAME, (state = DEFAULT_STATE, action) => {
16
+    STORE_NAME, (state = {}, action) => {
23 17
         switch (action.type) {
24 18
         case PROFILE_UPDATED:
25
-            return {
26
-                profile: action.profile
27
-            };
19
+            return action.profile;
28 20
         }
29 21
 
30 22
         return state;

Loading…
İptal
Kaydet