2017-05-31 05:24:34 +00:00
|
|
|
import { ReducerRegistry } from '../base/redux';
|
2017-04-20 23:28:03 +00:00
|
|
|
|
|
|
|
import {
|
2017-09-29 20:27:23 +00:00
|
|
|
SET_INFO_DIALOG_VISIBILITY,
|
2017-04-20 23:28:03 +00:00
|
|
|
UPDATE_DIAL_IN_NUMBERS_FAILED,
|
|
|
|
UPDATE_DIAL_IN_NUMBERS_SUCCESS
|
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
const DEFAULT_STATE = {
|
|
|
|
numbersEnabled: true
|
|
|
|
};
|
|
|
|
|
2017-05-31 05:32:13 +00:00
|
|
|
ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
|
|
|
|
switch (action.type) {
|
2017-09-29 20:27:23 +00:00
|
|
|
case SET_INFO_DIALOG_VISIBILITY:
|
|
|
|
return {
|
|
|
|
...state,
|
2017-10-11 17:27:56 +00:00
|
|
|
infoDialogVisible: action.visible,
|
|
|
|
infoDialogWillAutoClose: action.autoClose
|
2017-09-29 20:27:23 +00:00
|
|
|
};
|
|
|
|
|
2017-05-31 05:32:13 +00:00
|
|
|
case UPDATE_DIAL_IN_NUMBERS_FAILED:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
error: action.error
|
|
|
|
};
|
2017-04-20 23:28:03 +00:00
|
|
|
|
2017-05-31 05:32:13 +00:00
|
|
|
case UPDATE_DIAL_IN_NUMBERS_SUCCESS: {
|
2018-02-13 19:46:47 +00:00
|
|
|
const {
|
|
|
|
defaultCountry,
|
|
|
|
numbers,
|
|
|
|
numbersEnabled
|
|
|
|
} = action.dialInNumbers;
|
2017-04-20 23:28:03 +00:00
|
|
|
|
2017-05-31 05:32:13 +00:00
|
|
|
return {
|
2018-02-13 19:46:47 +00:00
|
|
|
...state,
|
2017-05-31 05:32:13 +00:00
|
|
|
conferenceID: action.conferenceID,
|
2018-02-13 19:46:47 +00:00
|
|
|
defaultCountry,
|
2017-05-31 05:32:13 +00:00
|
|
|
numbers,
|
|
|
|
numbersEnabled
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2017-04-20 23:28:03 +00:00
|
|
|
|
2017-05-31 05:32:13 +00:00
|
|
|
return state;
|
|
|
|
});
|