// SPDX-License-Identifier: AGPL-3.0
import { configActions, ConfigAction } from "./config-action";
-import { Config, mockConfig } from '~/common/config';
+import { mockConfig } from '~/common/config';
-export interface ConfigState {
- config: Config;
-}
-
-const initialState: ConfigState = {
- config: mockConfig({}),
-};
-
-export const configReducer = (state = initialState, action: ConfigAction) => {
+export const configReducer = (state = mockConfig({}), action: ConfigAction) => {
return configActions.match(action, {
CONFIG: ({ config }) => {
return {
- ...state, config
+ ...state, ...config
};
},
default: () => state
const mapStateToProps = (state: RootState): AccountMenuProps => ({
user: state.auth.user,
currentRoute: state.router.location ? state.router.location.pathname : '',
- workbenchURL: state.config.config.workbenchUrl,
+ workbenchURL: state.config.workbenchUrl,
});
const wb1URL = (route: string) => {