Skip to content

Commit

Permalink
fix: default date range issue
Browse files Browse the repository at this point in the history
  • Loading branch information
olekkorob committed Mar 14, 2023
1 parent a97bb53 commit 1f4182f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions web/src/components/LocationReportComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1353,11 +1353,17 @@ export default {
},
},
watch: {
'$route.query': function (newVal, oldVal) {
if (newVal.loc !== oldVal.loc) {
$route: function (newVal, oldVal) {
if (newVal.query.loc !== oldVal.query.loc) {
this.minDate = newVal.query.xmin;
this.maxDate = newVal.query.xmax;
this.newLocation = null;
this.createReport();
this.customMutations = this.grabCustomMutations();
} else {
this.minDate = newVal.query.xmin;
this.maxDate = newVal.query.xmax;
this.createReport();
}
},
recentWindow() {
Expand Down Expand Up @@ -1760,9 +1766,6 @@ export default {
this.maxDate = event.newMax;
this.minDate = event.newMin;
this.month = event.month;
this.setupReport();
this.updateMaps();
this.updateTable();
},
updateMapDateRange(month) {
this.month = month;
Expand All @@ -1788,9 +1791,6 @@ export default {
selected: queryParams.selected,
},
});
this.setupReport();
this.updateMaps();
this.updateTable();
},
getDateRangeText() {
if (this.xmin && this.xmax) {
Expand Down
9 changes: 5 additions & 4 deletions web/src/components/SituationReportComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1306,9 +1306,13 @@ export default {
this.newPangolin = null;
this.lineageName = null;
this.reportMetadata = null;
this.minDate = newVal.query.xmin;
this.maxDate = newVal.query.xmax;
this.setupReport();
} else {
this.updateLocations();
this.minDate = newVal.query.xmin;
this.maxDate = newVal.query.xmax;
this.setupReport();
}
},
},
Expand Down Expand Up @@ -1510,7 +1514,6 @@ export default {
// sublineagePrev
this.sublineagePrev = results.sublineagePrev;
// location prevalence
this.locationTotals = results.locPrev;
Expand Down Expand Up @@ -1836,8 +1839,6 @@ export default {
updateDateRange(event) {
this.maxDate = event.newMax;
this.minDate = event.newMin;
this.setupReport();
this.updateLocations();
},
},
};
Expand Down

0 comments on commit 1f4182f

Please sign in to comment.