Skip to content

Commit 06de49a

Browse files
committed
fix: add member in circles view instead of trying to add contacts
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 54dd2e2 commit 06de49a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/views/Contacts.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
<SettingsImportContacts v-if="!loadingContacts && isEmptyGroup && !isChartView" />
3434
<!-- new-contact-button -->
3535
<Button v-if="!loadingContacts"
36-
type="secondary"
37-
:wide="true"
3836
:disabled="!defaultAddressbook"
37+
type="secondary"
38+
wide
3939
@click="newContact">
4040
<template #icon>
4141
<IconAdd :size="20" />
4242
</template>
43-
{{ t('contacts','New contact') }}
43+
{{ isCirclesView ? t('contacts','Add member') : t('contacts','New contact') }}
4444
</Button>
4545
</div>
4646
</RootNavigation>
@@ -95,6 +95,7 @@ import rfcProps from '../models/rfcProps.js'
9595
9696
import client from '../services/cdav.js'
9797
import isCirclesEnabled from '../services/isCirclesEnabled.js'
98+
import { emit } from '@nextcloud/event-bus'
9899
99100
export default {
100101
name: 'Contacts',
@@ -175,6 +176,11 @@ export default {
175176
isChartView() {
176177
return !!this.selectedChart
177178
},
179+
180+
isCirclesView() {
181+
return !!this.selectedCircle
182+
},
183+
178184
/**
179185
* Are we importing contacts ?
180186
*
@@ -282,6 +288,10 @@ export default {
282288
283289
methods: {
284290
async newContact() {
291+
if (this.isCirclesView) {
292+
emit('contacts:circles:append', this.selectedCircle.id)
293+
return
294+
}
285295
const rev = new VCardTime()
286296
const contact = new Contact(`
287297
BEGIN:VCARD

0 commit comments

Comments
 (0)