Skip to content
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

fix(InvitationHandler): minor fixes #11732

Merged
merged 1 commit into from
Mar 7, 2024
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
23 changes: 13 additions & 10 deletions src/components/LeftSidebar/InvitationHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,16 @@ export default {
},

invitations() {
const pendingShares = this.federationStore.pendingShares
for (const id in pendingShares) {
pendingShares[id] = Object.assign({}, pendingShares[id], {
const invitations = {}
for (const id in this.federationStore.pendingShares) {
invitations[id] = {
...this.federationStore.pendingShares[id],
type: CONVERSATION.TYPE.GROUP,
isFederatedConversation: true,
isDummyConversation: true,
})
}
}
return pendingShares
return invitations
},
},

Expand All @@ -145,17 +146,19 @@ export default {
if (conversation?.token) {
this.$store.dispatch('addConversation', conversation)
}
if (this.invitations.length === 0) {
this.closeModal()
}
this.checkIfNoMoreInvitations()
},

async rejectShare(id) {
await this.federationStore.rejectShare(id)
if (this.invitations.length === 0) {
this.checkIfNoMoreInvitations()
},

checkIfNoMoreInvitations() {
if (Object.keys(this.invitations).length === 0) {
this.closeModal()
}
},
}
},
}
</script>
Expand Down
Loading