summaryrefslogtreecommitdiffstats
path: root/src/components/AppContent
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-03-15 11:48:15 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-05-30 10:28:56 +0200
commit77cc60e0edd627d3bbed63f0e34b13822b387baf (patch)
treecb8c26f64f3fb88175dd8ad90d1347865321dfb6 /src/components/AppContent
parent21c5e699ffa394c45094e898af0f5192cf239bee (diff)
New member button and virtual list
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components/AppContent')
-rw-r--r--src/components/AppContent/CircleContent.vue24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/components/AppContent/CircleContent.vue b/src/components/AppContent/CircleContent.vue
index d382ae16..164aaf5b 100644
--- a/src/components/AppContent/CircleContent.vue
+++ b/src/components/AppContent/CircleContent.vue
@@ -50,7 +50,7 @@
</EmptyContent>
<EmptyContent v-else-if="circle.isPendingJoin" icon="icon-loading">
- {{ t('contacts', 'Joining circle') }}
+ {{ t('contacts', 'Your request to join this circle is pending approval') }}
</EmptyContent>
<EmptyContent v-else icon="icon-loading">
@@ -76,7 +76,8 @@ import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
import CircleDetails from '../CircleDetails'
import MemberList from '../MemberList'
import RouterMixin from '../../mixins/RouterMixin'
-import { MEMBER_LEVEL_NONE } from '../../models/constants'
+import { joinCircle } from '../../services/circles.ts'
+import { showError } from '@nextcloud/dialogs'
export default {
name: 'CircleContent',
@@ -123,14 +124,6 @@ export default {
isEmptyCircle() {
return this.members.length === 0
},
-
- /**
- * Is the current user member of this circle?
- * @returns {boolean}
- */
- isMemberOfCircle() {
- return this.circle.initiator?.level > MEMBER_LEVEL_NONE
- },
},
watch: {
@@ -150,8 +143,17 @@ export default {
/**
* Request to join this circle
*/
- requestJoin() {
+ async requestJoin() {
this.loadingJoin = true
+
+ try {
+ await joinCircle(this.circle.id)
+ } catch (error) {
+ showError(t('contacts', 'Unable to join the circle'))
+ } finally {
+ this.loadingJoin = false
+ }
+
},
},
}