Delay showing the dialog until after joining the conference instead of as soon as possible. This resolves a few issues. One is the dialog displaying right before the permissions overlay is shown. Another is that logically it does not make sense to show the invite options when unable to invite. It also sidesteps the initial react UI bootstrapping that can cause race conditions with toolbar re-renders causing misalignment. Lastly, it prepares prematurely for what I assume will be changes for when the info dialog will actually be shown automatically.
40 lines
872 B
JavaScript
40 lines
872 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 = {
|
|
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;
|
|
});
|