Detect leave dialog last room

This commit is contained in:
N-Pex 2021-04-02 10:06:25 +02:00
parent b7d280f675
commit 7506280ab1
3 changed files with 20 additions and 4 deletions

View file

@ -6,11 +6,11 @@
<h2 class="dialog-title">
Goodbye, {{ $matrix.currentUserDisplayName }}.
</h2>
<div v-if="$matrix.currentUser.is_guest" class="dialog-text">
<div v-if="$matrix.currentUser.is_guest && onlyJoinedToThisRoom" class="dialog-text">
If you want to join this group again, you can join under a new identity. To keep {{ $matrix.currentUserDisplayName }}, <a @click.prevent="viewProfile">create an account</a>.
</div>
<div v-else class="dialog-text">
Since this group is public, you can join again later.
You can always join this room again if you know the link.
</div>
</template>
<template v-else>
@ -82,6 +82,16 @@ export default {
},
},
computed: {
onlyJoinedToThisRoom() {
const joinedRooms = this.$matrix.joinedRooms;
if (joinedRooms && joinedRooms.length == 1 && joinedRooms[0].roomId == this.room.roomId) {
return true;
}
return false;
}
},
methods: {
onLeaveRoom() {
//this.$matrix.matrixClient.forget(this.room.roomId, true, undefined)