Add basic "home" screen with room list
This commit is contained in:
parent
c489d58a69
commit
9c9619fe1c
5 changed files with 24 additions and 9 deletions
|
|
@ -1,11 +1,26 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
HOME
|
<RoomList />
|
||||||
|
<v-btn block class="outlined-button" @click.stop="logout">Logout</v-btn>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import RoomList from '../components/RoomList';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
RoomList
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
logout() {
|
||||||
|
//TODO - For guest accounts, show warning about not being able to rejoin.
|
||||||
|
this.$store.dispatch("auth/logout");
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$navigation.push({path: "/login"}, -1);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export default {
|
||||||
this.$matrix.leaveRoom(roomId)
|
this.$matrix.leaveRoom(roomId)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("Left room");
|
console.log("Left room");
|
||||||
this.$navigation.push({name:'Chat', 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);
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,11 @@ export default {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.$store.dispatch("auth/login", user).then(
|
this.$store.dispatch("auth/login", user).then(
|
||||||
() => {
|
() => {
|
||||||
this.$navigation.push({name: "Chat", params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) }}, -1);
|
if (this.$matrix.currentRoomId) {
|
||||||
|
this.$navigation.push({name: "Chat", params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) }}, -1);
|
||||||
|
} else {
|
||||||
|
this.$navigation.push({name: "Home"}, -1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
||||||
|
|
@ -291,10 +291,6 @@ export default {
|
||||||
this.$navigation.push({ name: "Profile" }, 1);
|
this.$navigation.push({ name: "Profile" }, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
leaveRoom() {
|
|
||||||
console.log("Leave");
|
|
||||||
},
|
|
||||||
|
|
||||||
upgradeAccount() {
|
upgradeAccount() {
|
||||||
this.$matrix
|
this.$matrix
|
||||||
.upgradeGuestAccount()
|
.upgradeGuestAccount()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
//import Home from '../components/Home.vue'
|
import Home from '../components/Home.vue'
|
||||||
import Chat from '../components/Chat.vue'
|
import Chat from '../components/Chat.vue'
|
||||||
import Join from '../components/Join.vue'
|
import Join from '../components/Join.vue'
|
||||||
import Login from '../components/Login.vue'
|
import Login from '../components/Login.vue'
|
||||||
|
|
@ -13,7 +13,7 @@ const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
component: Chat
|
component: Home
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/room/:roomId?',
|
path: '/room/:roomId?',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue