fix: notification types

This commit is contained in:
iamsivin
2024-03-14 15:53:34 +05:30
parent f419dcc662
commit 8b207a9a94
4 changed files with 9 additions and 9 deletions
@@ -18,13 +18,7 @@
},
"TYPES": {
"CONVERSATION_MENTION": "Mention",
"CONVERSATION_ASSIGNMENT": "Assigned to you",
"CONVERSATION_CREATION": "",
"ASSIGNED_CONVERSATION_NEW_MESSAGE": "",
"PARTICIPATING_CONVERSATION_NEW_MESSAGE": "",
"SLA_MISSED_FIRST_RESPONSE": "",
"SLA_MISSED_NEXT_RESPONSE": "",
"SLA_MISSED_RESOLUTION": ""
"CONVERSATION_ASSIGNMENT": "Assigned to you"
},
"MENU_ITEM": {
"MARK_AS_READ": "Mark as read",
@@ -160,8 +160,13 @@ export default {
return this.notificationItem?.push_message_body;
},
notificationTypes() {
const usedTypes = ['CONVERSATION_MENTION', 'CONVERSATION_ASSIGNMENT'];
const { notification_type: notificationType } = this.notificationItem;
return this.$t(`INBOX.TYPES.${notificationType?.toUpperCase()}`);
const upperCaseType = notificationType?.toUpperCase();
return usedTypes.includes(upperCaseType)
? this.$t(`INBOX.TYPES.${upperCaseType}`)
: '';
},
notificationTypeIcon() {
const { notification_type: notificationType } = this.notificationItem;
@@ -13,6 +13,7 @@
<fluent-icon
class="flex-shrink-0 text-slate-700 dark:text-slate-200"
:icon="inboxIcon"
type="outline"
size="14"
/>
</div>
@@ -65,7 +65,7 @@ export default {
pathSource() {
// To support icons with multiple paths
const path = this.icons[`${this.icon}-${this.type}`];
if (path.constructor === Array) {
if (path?.constructor === Array) {
return path;
}
return [path];