diff options
-rw-r--r-- | css/icons.scss | 1 | ||||
-rw-r--r-- | src/views/Contacts.vue | 18 |
2 files changed, 15 insertions, 4 deletions
diff --git a/css/icons.scss b/css/icons.scss index 0685ea09..14889d61 100644 --- a/css/icons.scss +++ b/css/icons.scss @@ -31,6 +31,7 @@ @include icon-black-white('language', 'contacts', 2); @include icon-black-white('clone', 'contacts', 2); @include icon-black-white('sync', 'contacts', 2); +@include icon-black-white('recent-actors', 'contacts', 1); // social network icons: @include icon-black-white('facebook', 'contacts', 2); // “facebook (fab)” by fontawesome.com is licensed under CC BY 4.0. (https://fontawesome.com/icons/facebook?style=brands) diff --git a/src/views/Contacts.vue b/src/views/Contacts.vue index ded863e3..082f42be 100644 --- a/src/views/Contacts.vue +++ b/src/views/Contacts.vue @@ -158,7 +158,7 @@ {{ n('contacts', 'Adding {total} contact to {name}', 'Adding {total} contacts to {name}', - total, + processStatus.total, processStatus ) }} </ProcessingScreen> @@ -330,7 +330,7 @@ export default { // generate groups menu from groups store groupsMenu() { - return this.groups.map(group => { + const menu = this.groups.map(group => { return Object.assign(group, { id: group.name.replace(' ', '_'), key: group.name.replace(' ', '_'), @@ -341,10 +341,20 @@ export default { icon: group.name === t('contactsinteraction', 'Recently contacted') ? 'icon-recent-actors' : '', + toString: () => group.name, }) - }).sort(function(a, b) { - return parseInt(b.contacts.length) - parseInt(a.contacts.length) }) + menu.sort() + + // Find the Recently Contacted group, delete it from array and put it at first place of the array + const recentlyIndex = menu.findIndex( + group => group.text === t('contactsinteraction', 'Recently contacted') + ) + if (recentlyIndex >= 0) { + menu.unshift(menu.splice(recentlyIndex, 1)[0]) + } + + return menu }, /** |