2016-11-16 05:00:28 +08:00
|
|
|
import React from 'react';
|
2017-04-29 04:01:02 +08:00
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
|
|
|
import { makeCall } from '/imports/ui/services/api';
|
2017-08-01 21:10:12 +08:00
|
|
|
import VoiceUsers from '/imports/api/2.0/voice-users';
|
2016-11-16 05:00:28 +08:00
|
|
|
import Auth from '/imports/ui/services/auth/index';
|
2016-12-09 02:11:49 +08:00
|
|
|
import MuteAudio from './component';
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2017-08-01 21:10:12 +08:00
|
|
|
const MuteAudioContainer = props => (<MuteAudio {...props} />);
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2017-08-01 21:10:12 +08:00
|
|
|
export default createContainer(() => {
|
2016-12-07 05:15:23 +08:00
|
|
|
const userId = Auth.userID;
|
2017-08-01 21:10:12 +08:00
|
|
|
const voiceUser = VoiceUsers.findOne({ intId: userId });
|
|
|
|
|
2017-09-21 08:42:35 +08:00
|
|
|
const { muted, joined, talking, listenOnly } = voiceUser;
|
2017-02-03 00:46:49 +08:00
|
|
|
|
2017-08-05 04:05:18 +08:00
|
|
|
const callback = () => makeCall('toggleSelfVoice');
|
2016-12-09 02:11:49 +08:00
|
|
|
|
2016-11-16 05:00:28 +08:00
|
|
|
const data = {
|
2017-08-01 21:41:24 +08:00
|
|
|
isInAudio: joined,
|
|
|
|
isMuted: muted,
|
2016-12-09 02:11:49 +08:00
|
|
|
callback,
|
2017-08-01 21:41:24 +08:00
|
|
|
isTalking: talking,
|
2017-09-21 08:42:35 +08:00
|
|
|
listenOnly,
|
2016-11-16 05:00:28 +08:00
|
|
|
};
|
|
|
|
return data;
|
|
|
|
}, MuteAudioContainer);
|