2016-11-16 05:00:28 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
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-06 01:07:25 +08:00
|
|
|
import JoinAudioOptions from './component';
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2017-08-01 21:10:12 +08:00
|
|
|
const JoinAudioOptionsContainer = props => (<JoinAudioOptions {...props} />);
|
2016-11-16 05:00:28 +08:00
|
|
|
|
|
|
|
export default createContainer((params) => {
|
2017-08-01 21:10:12 +08:00
|
|
|
const userId = Auth.userID;
|
|
|
|
const voiceUser = VoiceUsers.findOne({ intId: userId });
|
|
|
|
|
|
|
|
const { joined, listenOnly } = voiceUser;
|
2016-11-19 05:24:59 +08:00
|
|
|
|
|
|
|
return {
|
2017-08-01 21:41:24 +08:00
|
|
|
isInAudio: joined,
|
|
|
|
isInListenOnly: listenOnly,
|
2017-03-15 06:34:57 +08:00
|
|
|
handleJoinAudio: params.handleJoinAudio,
|
|
|
|
handleCloseAudio: params.handleCloseAudio,
|
2016-11-16 05:00:28 +08:00
|
|
|
};
|
2016-12-06 01:07:25 +08:00
|
|
|
}, JoinAudioOptionsContainer);
|