Skip to content

Commit 380f85e

Browse files
committed
when viewing other routes, reset history info
1 parent 367fcd1 commit 380f85e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

frontend/src/views/app/History.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<NavBar v-bind:currentRoute="'History'"></NavBar>
55
<section class="mx-auto">
66
<HistoryRecommendations
7+
v-if="firstTimeAnalysisDone"
78
v-bind:ready="recommendationsAnalysisDone"
89
v-on:update-history="updateHistory"
910
v-bind:title="'Potential matches'"
@@ -44,15 +45,12 @@ export default {
4445
interests: [],
4546
},
4647
recommendationsAnalysisDone: false,
48+
firstTimeAnalysisDone: false,
4749
}),
4850
methods: {
4951
async fetchUsers() {
50-
if (this.recommendationsFromSettingUp) {
51-
this.recommendations = this.recommendationsFromSettingUp;
52-
} else {
53-
const recommendationsRequest = await this.$http.get('/recommendations');
54-
this.recommendations = recommendationsRequest.data.recommendations;
55-
}
52+
const recommendationsRequest = await this.$http.get('/recommendations');
53+
this.recommendations = recommendationsRequest.data.recommendations;
5654
this.recommendations.sort((a, b) => a.distance - b.distance);
5755
for (let i = 0; i < this.recommendations.length; i += 1) {
5856
this.recommendations[i].distance = Math.floor(this.recommendations[i].distance);
@@ -87,6 +85,7 @@ export default {
8785
}
8886
}
8987
this.recommendationsAnalysisDone = true;
88+
this.firstTimeAnalysisDone = true;
9089
},
9190
browseAgain() {
9291
this.recommendations = [];
@@ -121,6 +120,7 @@ export default {
121120
},
122121
deactivated() {
123122
if (!this.$route.path.startsWith('/users')) {
123+
this.firstTimeAnalysisDone = false;
124124
this.browseAgain();
125125
this.fetchUsers();
126126
this.$el.scrollTop = 0;

0 commit comments

Comments
 (0)