Files
jitsi-meet/react/features/invite/reducer.js
virtuacoplenny cfe4564ab3 feat(info): automatically show the info dialog (#2018)
* ref(info): be able to open dialog through store

* feat(info): automatically show the info dialog

Conditions:
- Lonely call
- Has not opened the info dialog yet

* squash: change to show on start, hide later

* squash: update naming and comment
2017-09-29 15:27:23 -05:00

44 lines
971 B
JavaScript

import { ReducerRegistry } from '../base/redux';
import {
SET_INFO_DIALOG_VISIBILITY,
UPDATE_DIAL_IN_NUMBERS_FAILED,
UPDATE_DIAL_IN_NUMBERS_SUCCESS
} from './actionTypes';
const DEFAULT_STATE = {
// By default show the info dialog when joining the conference.
infoDialogVisible: true,
numbersEnabled: true
};
ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
switch (action.type) {
case SET_INFO_DIALOG_VISIBILITY:
return {
...state,
infoDialogVisible: action.visible
};
case UPDATE_DIAL_IN_NUMBERS_FAILED:
return {
...state,
error: action.error
};
case UPDATE_DIAL_IN_NUMBERS_SUCCESS: {
const { numbers, numbersEnabled } = action.dialInNumbers;
return {
conferenceID: action.conferenceID,
numbers,
numbersEnabled
};
}
}
return state;
});