chore: Replace inboxMixin with useInbox composable

This commit is contained in:
Fayaz Ahmed
2024-08-23 15:07:27 +05:30
parent 8473e72a7e
commit 6577b40f90
15 changed files with 378 additions and 66 deletions
@@ -6,7 +6,7 @@ import MessagePreview from './MessagePreview.vue';
import router from '../../../routes';
import { frontendURL, conversationUrl } from '../../../helper/URLHelper';
import InboxName from '../InboxName.vue';
import inboxMixin from 'shared/mixins/inboxMixin';
import { useInbox } from 'shared/composables/useInbox';
import ConversationContextMenu from './contextMenu/Index.vue';
import TimeAgo from 'dashboard/components/ui/TimeAgo.vue';
import CardLabels from './conversationCardComponents/CardLabels.vue';
@@ -24,7 +24,6 @@ export default {
PriorityMark,
SLACardLabel,
},
mixins: [inboxMixin],
props: {
activeLabel: {
type: String,
@@ -67,6 +66,14 @@ export default {
default: false,
},
},
setup(props) {
const { inbox_id: inboxId } = props.chat;
const { inboxBadge, inbox } = useInbox({ inboxId });
return {
inboxBadge,
inbox,
};
},
data() {
return {
hovered: false,
@@ -121,12 +128,6 @@ export default {
return getLastMessage(this.chat);
},
inbox() {
const { inbox_id: inboxId } = this.chat;
const stateInbox = this.$store.getters['inboxes/getInbox'](inboxId);
return stateInbox;
},
showInboxName() {
return (
!this.hideInboxName &&