diff --git a/frontend/src/views/Friends.vue b/frontend/src/views/Friends.vue
index ed5ea59..1786b5c 100644
--- a/frontend/src/views/Friends.vue
+++ b/frontend/src/views/Friends.vue
@@ -38,7 +38,7 @@
- {{ friend.name }} |
+ {{ friend.username }} |
{{ friend.server.join(', ') }} |
@@ -124,12 +124,7 @@ export default {
return this.$route.params.username
},
friendslist() {
- return Object.keys(this.friends).map((friend) => {
- return {
- name: friend,
- server: this.friends[friend]
- }
- })
+ return Object.entries(this.friends).map(([_, friend]) => friend)
}
},
methods: {
@@ -137,8 +132,8 @@ export default {
fetchContent() {
this.getFriends().then((friends) => {
friends.map((friend) => {
- this.getFriendServer({username: friend}).then((server) => {
- this.friends[friend] = server
+ this.getFriendServer(friend).then((server) => {
+ this.friends[friend.username] = {...friend, server: server}
})
})
})
@@ -159,7 +154,7 @@ export default {
}).catch(() => {})
},
tryAcceptFriend(request) {
- this.acceptFriend({id: request.id, secret: request.secret}).then((ok) => {
+ this.acceptFriend({id: request.id, secret: request.secret, befriender: request.befriender}).then((ok) => {
if (ok) {
this.fetchContent()
}
|