parent
d0a5fcb79a
commit
31535f0f3c
4 changed files with 109 additions and 47 deletions
|
|
@ -61,6 +61,16 @@ body { position:absolute; top:0; bottom:0; right:0; left:0; }
|
||||||
margin-bottom: $chat-standard-padding-xs;
|
margin-bottom: $chat-standard-padding-xs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v-btn.text-button {
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 11 * $chat-text-size;
|
||||||
|
border: none;
|
||||||
|
height: $chat-standard-padding;
|
||||||
|
margin-top: $chat-standard-padding-xs;
|
||||||
|
margin-bottom: $chat-standard-padding-xs;
|
||||||
|
}
|
||||||
|
|
||||||
.v-btn.filled-button {
|
.v-btn.filled-button {
|
||||||
font-family: 'Inter', sans-serif;
|
font-family: 'Inter', sans-serif;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|
@ -73,12 +83,26 @@ body { position:absolute; top:0; bottom:0; right:0; left:0; }
|
||||||
margin-bottom: $chat-standard-padding-xs;
|
margin-bottom: $chat-standard-padding-xs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v-dialog {
|
||||||
|
border-radius: 20px !important;
|
||||||
|
.dialog-content {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-text {
|
.dialog-text {
|
||||||
|
text-align: left;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
|
a {
|
||||||
|
color: black;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.build-version {
|
.build-version {
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,61 @@
|
||||||
<template>
|
<template>
|
||||||
<v-dialog v-model="showDialog" v-show="room" class="ma-0 pa-0" width="80%">
|
<v-dialog v-model="showDialog" v-show="room" class="ma-0 pa-0" width="80%">
|
||||||
<v-card>
|
<div class="dialog-content text-center">
|
||||||
<v-card-title class="dialog-title">Are you sure you want to leave?</v-card-title>
|
<template v-if="roomJoinRule == 'public'">
|
||||||
<v-card-text>
|
<h1>👋</h1>
|
||||||
<div class="dialog-text">You may not be able to rejoin.</div>
|
<h2 class="dialog-title">
|
||||||
</v-card-text>
|
Goodbye, {{ $matrix.currentUserDisplayName }}.
|
||||||
<v-divider></v-divider>
|
</h2>
|
||||||
<v-card-actions>
|
<div v-if="$matrix.currentUser.is_guest" class="dialog-text">
|
||||||
<v-spacer></v-spacer>
|
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>.
|
||||||
<v-btn text @click="showDialog = false">Cancel</v-btn>
|
</div>
|
||||||
|
<div v-else class="dialog-text">
|
||||||
|
Since this group is public, you can join again later.
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<v-icon color="black" size="30">lock</v-icon>
|
||||||
|
<h2 class="dialog-title">Are you sure you want to leave?</h2>
|
||||||
|
<div class="dialog-text">
|
||||||
|
This group is locked. You cannot rejoin without a special permission.
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<v-container fluid>
|
||||||
|
<v-row cols="12">
|
||||||
|
<v-col cols="6">
|
||||||
<v-btn
|
<v-btn
|
||||||
color="primary"
|
depressed
|
||||||
text
|
text
|
||||||
@click="
|
block
|
||||||
|
class="text-button"
|
||||||
|
@click="showDialog = false"
|
||||||
|
>Go back</v-btn
|
||||||
|
>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="6" align="center">
|
||||||
|
<v-btn
|
||||||
|
color="red"
|
||||||
|
depressed
|
||||||
|
block
|
||||||
|
class="filled-button"
|
||||||
|
@click.stop="
|
||||||
onLeaveRoom();
|
onLeaveRoom();
|
||||||
showDialog = false;
|
showDialog = false;
|
||||||
"
|
"
|
||||||
>Next</v-btn
|
>Leave</v-btn
|
||||||
>
|
>
|
||||||
</v-card-actions>
|
</v-col>
|
||||||
</v-card>
|
</v-row>
|
||||||
|
</v-container>
|
||||||
|
</div>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import roomInfoMixin from "./roomInfoMixin";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "LeaveRoomDialog",
|
name: "LeaveRoomDialog",
|
||||||
|
mixins: [roomInfoMixin],
|
||||||
props: {
|
props: {
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
@ -32,12 +63,6 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
room: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -52,24 +77,30 @@ export default {
|
||||||
},
|
},
|
||||||
showDialog() {
|
showDialog() {
|
||||||
if (!this.showDialog) {
|
if (!this.showDialog) {
|
||||||
this.$emit('close');
|
this.$emit("close");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onLeaveRoom() {
|
onLeaveRoom() {
|
||||||
//this.$matrix.matrixClient.forget(this.room.roomId, true, undefined)
|
//this.$matrix.matrixClient.forget(this.room.roomId, true, undefined)
|
||||||
const roomId = this.room.roomId;
|
const roomId = this.room.roomId;
|
||||||
this.$matrix.leaveRoom(roomId)
|
this.$matrix
|
||||||
|
.leaveRoom(roomId)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("Left room");
|
console.log("Left room");
|
||||||
this.$navigation.push({name:'Home', params:{roomId:null}}, -1);
|
this.$navigation.push({ name: "Home", params: { roomId: null } }, -1);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
console.log("Error leaving", err);
|
console.log("Error leaving", err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
viewProfile() {
|
||||||
|
this.showDialog = false;
|
||||||
|
this.$navigation.push({ name: "Profile" }, 1);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
Your are logged in as <b>{{ displayName }}</b
|
Your are logged in as <b>{{ displayName }}</b
|
||||||
>.
|
>.
|
||||||
</div>
|
</div>
|
||||||
<v-btn block class="outlined-button" @click.stop="viewProfile"
|
<v-btn depressed block class="outlined-button" @click.stop="viewProfile"
|
||||||
>View</v-btn
|
>View</v-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -124,6 +124,7 @@
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-btn
|
<v-btn
|
||||||
color="red"
|
color="red"
|
||||||
|
depressed
|
||||||
block
|
block
|
||||||
class="filled-button"
|
class="filled-button"
|
||||||
@click.stop="showLeaveConfirmation = true"
|
@click.stop="showLeaveConfirmation = true"
|
||||||
|
|
@ -170,8 +171,6 @@ export default {
|
||||||
showLeaveConfirmation: false,
|
showLeaveConfirmation: false,
|
||||||
expandedMembers: [],
|
expandedMembers: [],
|
||||||
buildVersion: "",
|
buildVersion: "",
|
||||||
roomJoinRule: null,
|
|
||||||
userCanChangeJoinRules: false,
|
|
||||||
updatingJoinRule: false, // Flag if we are processing update curerntly
|
updatingJoinRule: false, // Flag if we are processing update curerntly
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,14 @@ export default {
|
||||||
return user.user_id;
|
return user.user_id;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
currentUserDisplayName() {
|
||||||
|
if (this.ready) {
|
||||||
|
const user = this.matrixClient.getUser(this.currentUserId) || {}
|
||||||
|
return user.displayName;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
currentRoomId() {
|
currentRoomId() {
|
||||||
return this.$store.state.currentRoomId;
|
return this.$store.state.currentRoomId;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue