Skip to content

Commit

Permalink
fixup! feat(federation): introduce invitations inbox dialog
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Feb 20, 2024
1 parent 003054b commit 050ea8c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/LeftSidebar/InvitationHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@
<NcButton type="tertiary"
aria-label="t('spreed', 'Decline invitation')"
title="t('spreed', 'Decline invitation')"
:disabled="item.loading"
:disabled="isLoading"
@click="rejectShare(item.id)">
<template #icon>
<NcLoadingIcon v-if="item.loading" :size="20" />
<NcLoadingIcon v-if="isLoading" :size="20" />
<CancelIcon v-else :size="20" />
</template>
</NcButton>
<NcButton type="primary"
aria-label="t('spreed', 'Accept invitation')"
:disabled="item.loading"
:disabled="isLoading"
@click="acceptShare(item.id)">
<template #icon>
<NcLoadingIcon v-if="item.loading" :size="20" />
<NcLoadingIcon v-if="isLoading" :size="20" />
<CheckIcon v-else :size="20" />
</template>
{{ t('spreed', 'Accept') }}
Expand Down Expand Up @@ -107,6 +107,7 @@ export default {
data() {
return {
modal: false,
isLoading: false,
}
},

Expand Down Expand Up @@ -136,7 +137,9 @@ export default {
},

async acceptShare(id) {
this.isLoading = true
const conversation = await this.federationStore.acceptShare(id)
this.isLoading = false
if (conversation?.token) {
this.$store.dispatch('addConversation', conversation)
this.$router.push({ name: 'conversation', params: { token: conversation.token } })
Expand All @@ -145,7 +148,9 @@ export default {
},

async rejectShare(id) {
this.isLoading = true
await this.federationStore.rejectShare(id)
this.isLoading = false
if (this.invitations.length === 0) {
this.closeModal()
}
Expand Down

0 comments on commit 050ea8c

Please sign in to comment.