2019-10-29 07:20:54 +00:00
|
|
|
<template>
|
2022-01-12 10:55:27 +00:00
|
|
|
<div class="flex flex-1 flex-col justify-end">
|
2021-02-15 19:28:57 +00:00
|
|
|
<div class="flex flex-1 overflow-auto">
|
2022-01-12 10:55:27 +00:00
|
|
|
<!-- Load Converstion List Components Here -->
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
2022-01-12 10:55:27 +00:00
|
|
|
<team-availability
|
|
|
|
:available-agents="availableAgents"
|
|
|
|
:has-conversation="!!conversationSize"
|
|
|
|
@start-conversation="startConversation"
|
|
|
|
/>
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-05-09 16:32:43 +00:00
|
|
|
import configMixin from '../mixins/configMixin';
|
2020-10-18 18:02:22 +00:00
|
|
|
import TeamAvailability from 'widget/components/TeamAvailability';
|
|
|
|
import { mapGetters } from 'vuex';
|
2022-01-12 10:55:27 +00:00
|
|
|
import routerMixin from 'widget/mixins/routerMixin';
|
2019-10-29 07:20:54 +00:00
|
|
|
export default {
|
|
|
|
name: 'Home',
|
|
|
|
components: {
|
2020-10-18 18:02:22 +00:00
|
|
|
TeamAvailability,
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
2022-01-12 10:55:27 +00:00
|
|
|
mixins: [configMixin, routerMixin],
|
2020-07-07 18:34:44 +00:00
|
|
|
props: {
|
|
|
|
hasFetched: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-11-11 13:32:16 +00:00
|
|
|
isCampaignViewClicked: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2020-07-07 18:34:44 +00:00
|
|
|
},
|
2020-10-18 18:02:22 +00:00
|
|
|
data() {
|
2022-03-03 07:06:31 +00:00
|
|
|
return {};
|
2020-10-18 18:02:22 +00:00
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
computed: {
|
2020-10-18 18:02:22 +00:00
|
|
|
...mapGetters({
|
2021-02-15 18:44:13 +00:00
|
|
|
availableAgents: 'agent/availableAgents',
|
2021-11-11 13:32:16 +00:00
|
|
|
activeCampaign: 'campaign/getActiveCampaign',
|
2022-01-12 10:55:27 +00:00
|
|
|
conversationSize: 'conversation/getConversationSize',
|
2022-03-21 19:58:22 +00:00
|
|
|
currentUser: 'contacts/getCurrentUser',
|
2020-10-18 18:02:22 +00:00
|
|
|
}),
|
2020-02-05 05:57:22 +00:00
|
|
|
},
|
2020-10-18 18:02:22 +00:00
|
|
|
methods: {
|
|
|
|
startConversation() {
|
2022-03-21 19:58:22 +00:00
|
|
|
const isUserEmailAvailable = !!this.currentUser.email;
|
2022-01-12 10:55:27 +00:00
|
|
|
if (this.preChatFormEnabled && !this.conversationSize) {
|
2022-03-21 19:58:22 +00:00
|
|
|
return this.replaceRoute('prechat-form', {
|
|
|
|
disableContactFields: isUserEmailAvailable,
|
|
|
|
});
|
2022-01-12 10:55:27 +00:00
|
|
|
}
|
|
|
|
return this.replaceRoute('messages');
|
2021-09-02 06:43:53 +00:00
|
|
|
},
|
2020-10-18 18:02:22 +00:00
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
};
|
|
|
|
</script>
|