Files
jitsi-meet/react/features/invite/reducer.js
Leonard Kim d7cccacc12 feat(invite): include dial-in numbers in the invite modal
Create a new React Component for displaying a list of dial-in
numbers. The Component will fetch the numbers from a new
numberRetreviewUrl key/value set in config. If not present in
config, the Component will not be displayed.
2017-05-01 12:47:35 -07:00

48 lines
1.0 KiB
JavaScript

import {
ReducerRegistry
} from '../base/redux';
import {
UPDATE_DIAL_IN_NUMBERS_FAILED,
UPDATE_DIAL_IN_NUMBERS_REQUEST,
UPDATE_DIAL_IN_NUMBERS_SUCCESS
} from './actionTypes';
const DEFAULT_STATE = {
numbersEnabled: true
};
ReducerRegistry.register(
'features/invite/dial-in',
(state = DEFAULT_STATE, action) => {
switch (action.type) {
case UPDATE_DIAL_IN_NUMBERS_FAILED: {
return {
...state,
error: action.error,
loading: false
};
}
case UPDATE_DIAL_IN_NUMBERS_REQUEST: {
return {
...state,
error: null,
loading: true
};
}
case UPDATE_DIAL_IN_NUMBERS_SUCCESS: {
const { numbers, numbersEnabled } = action.response;
return {
error: null,
loading: false,
numbers,
numbersEnabled
};
}
}
return state;
});