Skip to content

Commit

Permalink
ref: clean up query parameter setting
Browse files Browse the repository at this point in the history
  • Loading branch information
satra committed Nov 1, 2024
1 parent a401e6b commit 881459b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ export default {
},
setActivity(index) {
if (!this.checkDisableBack && this.isProtocolUrl) { // check if disableBack not enabled
const query = this.$route.fullPath.replace(this.$route.path, '')
this.$router.push(`/activities/${index}` + query);
this.$router.push({
'path': `/activities/${index}`,
'query': this.$route.query});
}
},
updateProgress(progress) {
Expand Down
6 changes: 4 additions & 2 deletions src/components/Landing/Landing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ export default {
// eslint-disable-next-line consistent-return
const visibleAct = _.map(this.actVisibility, (ac, key) => (ac === true ? key : '')).filter(String);
const nextIndex = visibleAct[visibleAct.indexOf(currentIndex) + 1];
const query = this.$route.fullPath.replace(this.$route.path, '')
this.$router.push(`/activities/${nextIndex}` + query);
this.$router.push({
'path': `/activities/${nextIndex}`,
'query': this.$route.query}
);
},
},
};
Expand Down
5 changes: 3 additions & 2 deletions src/components/StudyIntroduction/StudyIntroduction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export default {
if (this.step < this.totalSteps) {
this.step += 1;
} else if (this.step === this.totalSteps) {
const query = this.$route.fullPath.replace(this.$route.path, '')
this.$router.push(`/activities/0` + query);
this.$router.push({
'path': `/activities/0`,
'query': this.$route.query});
}
},
learnMore() {
Expand Down
5 changes: 3 additions & 2 deletions src/components/Survey/Survey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@
const currentIndex = parseInt(this.$store.state.activityIndex);
const visibleAct = _.map(this.actVisibility, (ac, key) => (ac === true ? key : '')).filter(String);
const nextIndex = visibleAct[visibleAct.indexOf(currentIndex) + 1];
const query = this.$route.fullPath.replace(this.$route.path, '')
this.$router.push(`/activities/${nextIndex}` + query);
this.$router.push({
'path': `/activities/${nextIndex}`,
'query': this.$route.query});
},
uploadZipData() {
const Response = this.$store.state.exportResponses;
Expand Down

0 comments on commit 881459b

Please sign in to comment.