Skip to content

Commit ab6e6e9

Browse files
committed
fix glitch matches not showing
1 parent 1e8a5ee commit ab6e6e9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

frontend/src/views/app/Matches.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,15 @@ export default {
8888
const matchesRequest = await this.$http.get('/matches');
8989
const { matches } = matchesRequest.data;
9090
for (let i = 0; i < matches.length; i += 1) {
91-
for (let j = 0; j < this.messages.length; j += 1) {
92-
if (this.messages[j].length && this.messages[j][0].to_id !== matches[i].user_1) {
93-
const userRequest = await this.$http.get(`/users/${matches[i].user_1}`);
94-
this.matches.push(userRequest.data);
91+
if (!this.messages.length) {
92+
const userRequest = await this.$http.get(`/users/${matches[i].user_1}`);
93+
this.matches.push(userRequest.data);
94+
} else {
95+
for (let j = 0; j < this.messages.length; j += 1) {
96+
if (this.messages[j][0].to_id !== matches[i].user_1) {
97+
const userRequest = await this.$http.get(`/users/${matches[i].user_1}`);
98+
this.matches.push(userRequest.data);
99+
}
95100
}
96101
}
97102
}

0 commit comments

Comments
 (0)