summaryrefslogtreecommitdiffstats
path: root/src/views
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2019-03-25 09:54:40 +0100
committerGitHub <noreply@github.com>2019-03-25 09:54:40 +0100
commitb1d5f7fda40635aace3b3b8ad661ca0d4127c7f9 (patch)
tree9ca15630d944a08096836abf9d13780da8e5747d /src/views
parentfd8898f7456f7d52b2bd7a78f81017737ffcee23 (diff)
parentc14a47c787f3f610d309d71b9e7ab68904048441 (diff)
Merge pull request #1015 from nextcloud/fix/ungroupped/new-contact
Do not add `not grouped` to the new contacts groups
Diffstat (limited to 'src/views')
-rw-r--r--src/views/Contacts.vue19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/views/Contacts.vue b/src/views/Contacts.vue
index d540c2d6..6e5b4a09 100644
--- a/src/views/Contacts.vue
+++ b/src/views/Contacts.vue
@@ -83,6 +83,9 @@ import rfcProps from 'Models/rfcProps'
import client from 'Services/cdav'
+const GROUP_ALL_CONTACTS = t('contacts', 'All contacts')
+const GROUP_NO_GROUP_CONTACTS = t('contacts', 'Not grouped')
+
export default {
name: 'Contacts',
@@ -158,9 +161,9 @@ export default {
* @returns {Array}
*/
contactsList() {
- if (this.selectedGroup === t('contacts', 'All contacts')) {
+ if (this.selectedGroup === GROUP_ALL_CONTACTS) {
return this.sortedContacts
- } else if (this.selectedGroup === t('contacts', 'Not grouped')) {
+ } else if (this.selectedGroup === GROUP_NO_GROUP_CONTACTS) {
return this.ungroupedContacts.map(contact => this.sortedContacts.find(item => item.key === contact.key))
}
let group = this.groups.filter(group => group.name === this.selectedGroup)[0]
@@ -214,9 +217,9 @@ export default {
icon: 'icon-contacts-dark',
router: {
name: 'group',
- params: { selectedGroup: t('contacts', 'All contacts') }
+ params: { selectedGroup: GROUP_ALL_CONTACTS }
},
- text: t('contacts', 'All contacts'),
+ text: GROUP_ALL_CONTACTS,
utils: {
counter: this.sortedContacts.length
}
@@ -234,9 +237,9 @@ export default {
icon: 'icon-user',
router: {
name: 'group',
- params: { selectedGroup: t('contacts', 'Not grouped') }
+ params: { selectedGroup: GROUP_NO_GROUP_CONTACTS }
},
- text: t('contacts', 'Not grouped'),
+ text: GROUP_NO_GROUP_CONTACTS,
utils: {
counter: this.ungroupedContacts.length
}
@@ -321,8 +324,10 @@ export default {
}
}
}
+
// set group if it's selected already
- if (this.selectedGroup !== t('contacts', 'All contacts')) {
+ // BUT NOT if it's the _fake_ groups like all contacts and not grouped
+ if ([GROUP_ALL_CONTACTS, GROUP_NO_GROUP_CONTACTS].indexOf(this.selectedGroup) === -1) {
contact.groups = [ this.selectedGroup ]
}
try {