Skip to content

Commit 996cf5d

Browse files
committed
live update count of filtered results
1 parent 7783600 commit 996cf5d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

frontend/src/components/app/recommendations/HistoryRecommendations.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export default {
191191
base = this.filter(base);
192192
this.sort(base, this.sorting);
193193
this.recommendations = base;
194+
this.$emit('filtered-count', this.recommendations.length);
194195
},
195196
deep: true,
196197
},

frontend/src/views/app/History.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="flex items-center justify-center md:justify-start w-full mb-4">
77
<h1
88
class="text-3xl sm:text-5xl my-4 inline-block text-center leading-none onboarding-sub-container-content-heading">
9-
{{recommendations.length}}</h1>
9+
{{filteredCount}}</h1>
1010
<DropdownDisplayChoiceHistory
1111
v-on:save-single-choice="updateHistory"
1212
class="inline-block ml-4"
@@ -16,6 +16,7 @@
1616
</div>
1717
<HistoryRecommendations
1818
v-if="recommendationsAnalysisDone"
19+
v-on:filtered-count="filteredCountSave"
1920
v-bind:title="'Potential matches'"
2021
v-bind:recommendationsReceived="recommendations"
2122
v-bind:recommendationsAnalysis="recommendationsAnalysis"></HistoryRecommendations>
@@ -56,6 +57,7 @@ export default {
5657
interests: [],
5758
},
5859
recommendationsAnalysisDone: false,
60+
filteredCount: null,
5961
}),
6062
methods: {
6163
async fetchUsers(request) {
@@ -129,9 +131,14 @@ export default {
129131
this.fetchUsers(value);
130132
}
131133
},
134+
filteredCountSave(...args) {
135+
const [count] = args;
136+
this.filteredCount = count;
137+
},
132138
},
133139
async created() {
134140
await this.fetchUsers('People I viewed');
141+
this.filteredCount = this.recommendations.length;
135142
},
136143
deactivated() {
137144
if (!this.$route.path.startsWith('/users')) {

0 commit comments

Comments
 (0)