2017-09-22 02:50:21 +08:00
|
|
|
import React from 'react';
|
2017-10-28 01:08:43 +08:00
|
|
|
import { meetingIsBreakout } from '/imports/ui/components/app/service';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2018-04-26 03:34:22 +08:00
|
|
|
import { withRouter } from 'react-router';
|
2018-09-14 02:09:30 +08:00
|
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
2017-08-12 04:32:33 +08:00
|
|
|
import LogoutConfirmation from './component';
|
2017-10-28 01:08:43 +08:00
|
|
|
import {
|
|
|
|
isModerator,
|
|
|
|
endMeeting,
|
|
|
|
} from './service';
|
2017-08-12 04:32:33 +08:00
|
|
|
|
2017-10-28 01:08:43 +08:00
|
|
|
const LogoutConfirmationContainer = props => (
|
|
|
|
<LogoutConfirmation {...props} />
|
2017-09-22 02:50:21 +08:00
|
|
|
);
|
2017-08-12 04:32:33 +08:00
|
|
|
|
2018-05-10 02:07:40 +08:00
|
|
|
export default withRouter(withTracker(({ router }) => {
|
2018-04-26 03:34:22 +08:00
|
|
|
const APP_CONFIG = Meteor.settings.public.app;
|
2018-09-14 02:09:30 +08:00
|
|
|
const shouldShowFeedback = !meetingIsBreakout() && getFromUserSettings('askForFeedbackOnLogout', APP_CONFIG.askForFeedbackOnLogout);
|
2018-05-10 02:07:40 +08:00
|
|
|
const showFeedback = shouldShowFeedback ? () => router.push('/ended/430') : () => router.push('/logout');
|
2018-04-26 03:34:22 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
showEndMeeting: !meetingIsBreakout() && isModerator(),
|
|
|
|
handleEndMeeting: endMeeting,
|
|
|
|
showFeedback,
|
|
|
|
};
|
2018-05-10 02:07:40 +08:00
|
|
|
})(LogoutConfirmationContainer));
|