Update app/javascript/dashboard/mixins/uiSettings.js
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
parent
534eb909b7
commit
54076a35ec
1 changed files with 9 additions and 11 deletions
|
@ -18,20 +18,18 @@ export default {
|
|||
}),
|
||||
conversationSidebarItemsOrder() {
|
||||
const { conversation_sidebar_items_order: itemsOrder } = this.uiSettings;
|
||||
// If the sidebar order is not set, use the default order.
|
||||
if (!itemsOrder) {
|
||||
return DEFAULT_CONVERSATION_SIDEBAR_ITEMS_ORDER;
|
||||
}
|
||||
const items = itemsOrder;
|
||||
if (
|
||||
DEFAULT_CONVERSATION_SIDEBAR_ITEMS_ORDER.length !== itemsOrder.length
|
||||
) {
|
||||
|
||||
// If the sidebar order doesn't have the new elements, then add them to the list.
|
||||
DEFAULT_CONVERSATION_SIDEBAR_ITEMS_ORDER.forEach(item => {
|
||||
if (!itemsOrder.find(i => i.name === item.name)) {
|
||||
items.push(item);
|
||||
itemsOrder.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
return items;
|
||||
return itemsOrder;
|
||||
},
|
||||
contactSidebarItemsOrder() {
|
||||
const { contact_sidebar_items_order: itemsOrder } = this.uiSettings;
|
||||
|
|
Loading…
Reference in a new issue