stash
This commit is contained in:
parent
51d7788324
commit
21cb4018a3
1 changed files with 5 additions and 10 deletions
|
@ -38,7 +38,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="friend in friendslist" :key="friend.name">
|
<tr v-for="friend in friendslist" :key="friend.name">
|
||||||
<td>{{ friend.name }}</td>
|
<td>{{ friend.username }}</td>
|
||||||
<td class="d-none d-md-table-cell">{{ friend.server.join(', ') }}</td>
|
<td class="d-none d-md-table-cell">{{ friend.server.join(', ') }}</td>
|
||||||
<td class="table-action">
|
<td class="table-action">
|
||||||
<a href="#" class="align-middle">
|
<a href="#" class="align-middle">
|
||||||
|
@ -124,12 +124,7 @@ export default {
|
||||||
return this.$route.params.username
|
return this.$route.params.username
|
||||||
},
|
},
|
||||||
friendslist() {
|
friendslist() {
|
||||||
return Object.keys(this.friends).map((friend) => {
|
return Object.entries(this.friends).map(([_, friend]) => friend)
|
||||||
return {
|
|
||||||
name: friend,
|
|
||||||
server: this.friends[friend]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -137,8 +132,8 @@ export default {
|
||||||
fetchContent() {
|
fetchContent() {
|
||||||
this.getFriends().then((friends) => {
|
this.getFriends().then((friends) => {
|
||||||
friends.map((friend) => {
|
friends.map((friend) => {
|
||||||
this.getFriendServer({username: friend}).then((server) => {
|
this.getFriendServer(friend).then((server) => {
|
||||||
this.friends[friend] = server
|
this.friends[friend.username] = {...friend, server: server}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -159,7 +154,7 @@ export default {
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
tryAcceptFriend(request) {
|
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) {
|
if (ok) {
|
||||||
this.fetchContent()
|
this.fetchContent()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue