Skip to content

Commit c83c393

Browse files
committed
move match to messages when messaged
1 parent 98611d7 commit c83c393

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

frontend/src/views/app/Matches.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ export default {
8585
chatWithUserId: null,
8686
fetchingDone: false,
8787
}),
88+
watch: {
89+
messages: {
90+
handler() {
91+
const len = this.messages.length;
92+
const messagedIds = [];
93+
for (let i = 0; i < len; i += 1) {
94+
messagedIds.push(this.messages[i].with_user.id);
95+
}
96+
let i = this.matches.length;
97+
while (i--) {
98+
if (messagedIds.indexOf(this.matches[i].id) !== -1) {
99+
this.matches.splice(i, 1);
100+
}
101+
}
102+
},
103+
},
104+
},
88105
methods: {
89106
async fetchMatch(user1, user2) {
90107
if (this.$store.getters.getLoggedInUser.id === user1) {

0 commit comments

Comments
 (0)