parent
08d30e66f6
commit
7c202c2d2e
6 changed files with 145 additions and 89 deletions
|
|
@ -86,7 +86,7 @@
|
|||
class="filled-button mt-4"
|
||||
>{{ $t("login.login") }}</v-btn
|
||||
>
|
||||
<div class="mt-2 overline">{{ $t("login.or") }}</div>
|
||||
<div class="mt-2 overline" v-if="showCreateRoomOption">{{ $t("login.or") }}</div>
|
||||
<v-btn
|
||||
id="btn-create-room"
|
||||
color="primary"
|
||||
|
|
@ -94,6 +94,7 @@
|
|||
block
|
||||
@click.stop="handleCreateRoom"
|
||||
class="filled-button mt-2"
|
||||
v-if="showCreateRoomOption"
|
||||
>{{ $t("login.create_room") }}</v-btn
|
||||
>
|
||||
</v-form>
|
||||
|
|
@ -111,6 +112,20 @@ import logoMixin from "./logoMixin";
|
|||
export default {
|
||||
name: "Login",
|
||||
mixins:[rememberMeMixin, logoMixin],
|
||||
props: {
|
||||
showCreateRoomOption: {
|
||||
type: Boolean,
|
||||
default: function () {
|
||||
return true;
|
||||
},
|
||||
},
|
||||
redirect: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return null;
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
user: new User(this.$config.defaultServer, "", ""),
|
||||
|
|
@ -171,7 +186,10 @@ export default {
|
|||
this.loading = true;
|
||||
this.$store.dispatch("login", { user }).then(
|
||||
() => {
|
||||
if (this.$matrix.currentRoomId) {
|
||||
if (this.redirect) {
|
||||
this.$navigation.push({ name: this.redirect }, -1);
|
||||
}
|
||||
else if (this.$matrix.currentRoomId) {
|
||||
this.$navigation.push(
|
||||
{
|
||||
name: "Chat",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue