Skip to content

[stable6.0] fix: add member in circles view instead of trying to add contacts #4479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/views/Contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
<SettingsImportContacts v-if="!loadingContacts && isEmptyGroup && !isChartView" />
<!-- new-contact-button -->
<Button v-if="!loadingContacts"
type="secondary"
:wide="true"
:disabled="!defaultAddressbook"
type="secondary"
wide
@click="newContact">
<template #icon>
<IconAdd :size="20" />
</template>
{{ t('contacts','New contact') }}
{{ isCirclesView ? t('contacts','Add member') : t('contacts','New contact') }}
</Button>
</div>
</RootNavigation>
Expand Down Expand Up @@ -95,6 +95,7 @@ import rfcProps from '../models/rfcProps.js'

import client from '../services/cdav.js'
import isCirclesEnabled from '../services/isCirclesEnabled.js'
import { emit } from '@nextcloud/event-bus'

export default {
name: 'Contacts',
Expand Down Expand Up @@ -175,6 +176,11 @@ export default {
isChartView() {
return !!this.selectedChart
},

isCirclesView() {
return !!this.selectedCircle
},

/**
* Are we importing contacts ?
*
Expand Down Expand Up @@ -282,6 +288,10 @@ export default {

methods: {
async newContact() {
if (this.isCirclesView) {
emit('contacts:circles:append', this.selectedCircle.id)
return
}
const rev = new VCardTime()
const contact = new Contact(`
BEGIN:VCARD
Expand Down
Loading