diff --git a/frontend/src/components/Header.vue b/frontend/src/components/Header.vue
index 252624c..7b7429e 100644
--- a/frontend/src/components/Header.vue
+++ b/frontend/src/components/Header.vue
@@ -25,10 +25,7 @@
Group Settings
-
+
Leave Group
@@ -325,6 +322,13 @@
>
Style Toggle
+
{{
@@ -677,9 +681,7 @@ export default {
this.settings.dialog = true
},
groupLeave(id) {
- this.leave.item = this.$store.state.chats.find(
- (chat) => chat.id === id
- )
+ this.leave.item = this.$store.state.chats.find((chat) => chat.id === id)
this.leave.dialog = true
},
show(e, context, item, id) {
@@ -741,12 +743,7 @@ export default {
},
removeUserFromGroup(user) {
this.axios
- .delete(
- "/api/v1/association/" +
- this.settings.item.id +
- "/" +
- user.id
- )
+ .delete("/api/v1/association/" + this.settings.item.id + "/" + user.id)
.then(() => {
this.$toast.success("User has been removed from the group.")
})
@@ -756,15 +753,9 @@ export default {
},
giveUserAdmin(user) {
this.axios
- .put(
- "/api/v1/association/" +
- this.settings.item.id +
- "/" +
- user.id,
- {
- rank: "admin"
- }
- )
+ .put("/api/v1/association/" + this.settings.item.id + "/" + user.id, {
+ rank: "admin"
+ })
.then(() => {
this.$toast.success("User has been promoted to admin.")
})
@@ -797,12 +788,9 @@ export default {
},
addMembersToGroup() {
this.axios
- .post(
- "/api/v1/association/" + this.settings.item.chat.id,
- {
- users: this.settings.addMembers.users
- }
- )
+ .post("/api/v1/association/" + this.settings.item.chat.id, {
+ users: this.settings.addMembers.users
+ })
.then(() => {
this.settings.item.chat.users = this.settings.item.chat.users.concat(
this.settings.addMembers.users
@@ -821,7 +809,7 @@ export default {
.then(() => {
this.leave.dialog = false
this.$store.state.chats = this.$store.state.chats.filter(
- (chat) => chat.id !== this.leave.item.id
+ (chat) => chat.id !== this.leave.item.id
)
this.$router.push("/communications/friends")
this.leave.item = null
diff --git a/frontend/src/views/Communications/CommunicationsChat.vue b/frontend/src/views/Communications/CommunicationsChat.vue
index eec6eaa..5997c8e 100644
--- a/frontend/src/views/Communications/CommunicationsChat.vue
+++ b/frontend/src/views/Communications/CommunicationsChat.vue
@@ -282,6 +282,7 @@
outlined
autofocus
@keydown.enter="doSearch"
+ @keydown.esc="$store.state.searchPanel = false"
>
@@ -1071,7 +1072,7 @@ export default {
AjaxErrorHandler(this.$store)(e)
})
},
- jumpToMessage(id) {
+ async jumpToMessage(id) {
try {
console.log("Jumping to message", id)
const index = this.messages.findIndex((message) => message.id === id)
@@ -1086,8 +1087,13 @@ export default {
setTimeout(() => {
lastMessage.style.backgroundColor = ""
}, 1500)
+ } else {
+ this.offset = id
+ await this.getMessages()
+ this.jumpToMessage(id)
}
- } catch {
+ } catch (e) {
+ console.log(e)
console.log("Could not auto scroll (Jump to message)")
}
},
@@ -1144,9 +1150,9 @@ export default {
}
})
},
- getMessages() {
+ async getMessages() {
this.loadingMessages = true
- this.axios
+ await this.axios
.get(
process.env.VUE_APP_BASE_URL +
"/api/v1/communications/" +