From d02ab2c641921b7a5476fcc279f15625f03d71be Mon Sep 17 00:00:00 2001 From: zbettenbuk Date: Tue, 6 Feb 2018 13:18:05 +0100 Subject: [PATCH] Flatten the store of the profile feature --- react/features/base/profile/functions.js | 2 +- react/features/base/profile/reducer.js | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/react/features/base/profile/functions.js b/react/features/base/profile/functions.js index aa289e329..eb43c5348 100644 --- a/react/features/base/profile/functions.js +++ b/react/features/base/profile/functions.js @@ -11,5 +11,5 @@ export function getProfile(state: Object) { const profileStateSlice = state['features/base/profile']; - return profileStateSlice ? profileStateSlice.profile || {} : {}; + return profileStateSlice || {}; } diff --git a/react/features/base/profile/reducer.js b/react/features/base/profile/reducer.js index d43bce1d5..c13013424 100644 --- a/react/features/base/profile/reducer.js +++ b/react/features/base/profile/reducer.js @@ -5,26 +5,18 @@ import { PersistenceRegistry } from '../storage'; import { PROFILE_UPDATED } from './actionTypes'; -const DEFAULT_STATE = { - profile: {} -}; - const STORE_NAME = 'features/base/profile'; /** * Sets up the persistence of the feature base/profile. */ -PersistenceRegistry.register(STORE_NAME, { - profile: true -}); +PersistenceRegistry.register(STORE_NAME); ReducerRegistry.register( - STORE_NAME, (state = DEFAULT_STATE, action) => { + STORE_NAME, (state = {}, action) => { switch (action.type) { case PROFILE_UPDATED: - return { - profile: action.profile - }; + return action.profile; } return state;