diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-06-07 15:56:55 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-06-07 15:56:55 +0200 |
commit | dff889bf532d90c6b7d99aadf8624ffbf51aa01c (patch) | |
tree | eb2aca0b34831ff9f9c5e140d78cbf1c9dd95ad6 /src | |
parent | 9277c38288f987b9281d4c920b4a234c6eede1ee (diff) |
Fix new circle disabled button
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/AppNavigation/RootNavigation.vue | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/components/AppNavigation/RootNavigation.vue b/src/components/AppNavigation/RootNavigation.vue index 2d1da574..73ba814f 100644 --- a/src/components/AppNavigation/RootNavigation.vue +++ b/src/components/AppNavigation/RootNavigation.vue @@ -173,6 +173,7 @@ import isCirclesEnabled from '../../services/isCirclesEnabled' import isContactsInteractionEnabled from '../../services/isContactsInteractionEnabled' import RouterMixin from '../../mixins/RouterMixin' +import { showError } from '@nextcloud/dialogs' export default { name: 'RootNavigation', @@ -363,22 +364,27 @@ export default { // Check if already exists if (this.circles.find(circle => circle.name === circleName)) { - this.createGroupError = t('contacts', 'This circle already exists') + this.createCircleError = t('contacts', 'This circle already exists') return } - this.createCircleError = null - const circle = await this.$store.dispatch('createCircle', { circleName, isPersonal, isLocal }) - this.closeNewCircleIntro() + try { + const circle = await this.$store.dispatch('createCircle', { circleName, isPersonal, isLocal }) + this.closeNewCircleIntro() - // Select group - this.$router.push({ - name: 'circle', - params: { - selectedCircle: circle.id, - }, - }) + // Select group + this.$router.push({ + name: 'circle', + params: { + selectedCircle: circle.id, + }, + }) + } catch (error) { + showError(t('contacts', 'An error happened during the creation of the circle')) + } finally { + this.createCircleLoading = false + } }, closeNewCircleIntro() { this.isNewCircleModalOpen = false |