Skip to content

Commit c65d8a3

Browse files
committed
change how duplicate entries are filtered
1 parent fbddb00 commit c65d8a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/src/views/app/History.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default {
7777
const recommendationsRequest = await this.$http.get('/history/blocked');
7878
this.recommendations = recommendationsRequest.data.bloked;
7979
}
80-
this.recommendations = this.recommendations.filter((v, i, a) => a.findIndex((t) => (JSON.stringify(t) === JSON.stringify(v))) === i);
80+
this.recommendations = Object.values(this.recommendations.reduce((acc, cur) => Object.assign(acc, { [cur.id]: cur }), {}));
8181
this.recommendations.sort((a, b) => a.distance - b.distance);
8282
for (let i = 0; i < this.recommendations.length; i += 1) {
8383
this.recommendations[i].distance = Math.floor(this.recommendations[i].distance);

0 commit comments

Comments
 (0)