GetLink redesign

Also, try with entered username first (issue #524)
This commit is contained in:
N-Pex 2023-10-17 11:01:49 +02:00
parent 08d30e66f6
commit 7c202c2d2e
6 changed files with 145 additions and 89 deletions

View file

@ -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",