From 192707d8f0036fab8997980e6ff704f62b2937a1 Mon Sep 17 00:00:00 2001 From: N Pex Date: Mon, 9 Jan 2023 14:21:08 +0000 Subject: [PATCH] Don't redirect to login page if we have no account --- src/components/Join.vue | 73 +++++++++++++++++++++++++++++--------- src/components/Profile.vue | 59 ++---------------------------- src/plugins/utils.js | 59 ++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 72 deletions(-) diff --git a/src/components/Join.vue b/src/components/Join.vue index b614f2e..2020fa3 100644 --- a/src/components/Join.vue +++ b/src/components/Join.vue @@ -18,18 +18,41 @@
-
Choose a name to use.
+
Choose a name to use.
- - + + + + + - - + + @@ -68,6 +91,16 @@ + +

{{ $t("profile.select_language") }}

@@ -232,8 +265,10 @@ export default { }, methods: { removeHomeServer(roomName) { - let lastIndexDash = roomName.lastIndexOf("-"); - let lastIndex = lastIndexDash > 0 ? lastIndexDash : roomName.lastIndexOf(":"); + let lastIndex = roomName.lastIndexOf(":"); + if (roomName && roomName.startsWith("@")) { + return roomName.substring(roomName.indexOf("@") + 1, lastIndex); + } return roomName ? roomName.substring(roomName.indexOf("#") + 1, lastIndex) : ""; }, getRoomInfo() { @@ -375,8 +410,14 @@ export default { this.selectedProfile = Object.assign({}, value); // Make a copy, so editing does not destroy data }, - showAvatarPickerList() { - this.$refs.avatar.$refs.input.click(); + showAvatarPicker() { + this.$refs.avatar.click(); + }, + + handlePickedAvatar(event) { + util.loadAvatarFromFile(event, (image) => { + this.selectedProfile.image = image; + }); }, }, mounted() { diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 69f2435..4757e2a 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -197,11 +197,7 @@