2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-08-27 00:03:42 +00:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { mapDispatchToProps } from '../actions';
|
|
|
|
import { CallingDeviceSelection } from '../../components/CallingDeviceSelection';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { StateType } from '../reducer';
|
2020-08-27 00:03:42 +00:00
|
|
|
|
|
|
|
import { getIntl } from '../selectors/user';
|
|
|
|
|
|
|
|
const mapStateToProps = (state: StateType) => {
|
|
|
|
const {
|
|
|
|
availableMicrophones,
|
|
|
|
availableSpeakers,
|
|
|
|
selectedMicrophone,
|
|
|
|
selectedSpeaker,
|
|
|
|
availableCameras,
|
|
|
|
selectedCamera,
|
|
|
|
} = state.calling;
|
|
|
|
|
|
|
|
return {
|
|
|
|
availableCameras,
|
|
|
|
availableMicrophones,
|
|
|
|
availableSpeakers,
|
|
|
|
i18n: getIntl(state),
|
|
|
|
selectedCamera,
|
|
|
|
selectedMicrophone,
|
|
|
|
selectedSpeaker,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
|
|
|
export const SmartCallingDeviceSelection = smart(CallingDeviceSelection);
|