Skip to content

Commit 77b7a34

Browse files
committed
pass data from onboarding to browsing
1 parent 28cd671 commit 77b7a34

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

frontend/src/router/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const routes = [
100100
name: Browse,
101101
component: Browse,
102102
beforeEnter: notLoggedInRedirectLogin,
103+
props: true,
103104
},
104105
];
105106

frontend/src/views/app/Onboarding.vue

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@
9494
</template>
9595

9696
<script>
97-
/* eslint-disable */
97+
/* eslint-disable prefer-const */
9898
import Introduction from '@/components/app/onboarding/Introduction.vue';
9999
import SingleChoice from '@/components/app/onboarding/SingleChoice.vue';
100100
import MultipleChoice from '@/components/app/onboarding/MultipleChoice.vue';
101101
import MainAndSecondaryImagesUpload from '@/components/app/onboarding/MainAndSecondaryImagesUpload.vue';
102102
import Textblock from '@/components/app/onboarding/Textblock.vue';
103-
import Location from "@/components/app/onboarding/Location.vue";
104-
import SettingUp from "@/components/app/onboarding/SettingUp.vue";
103+
import Location from '@/components/app/onboarding/Location.vue';
104+
import SettingUp from '@/components/app/onboarding/SettingUp.vue';
105105
import Vue from 'vue';
106+
import Browse from '@/views/app/Browse.vue';
106107
107108
export default {
108109
components: {
@@ -126,8 +127,6 @@ export default {
126127
let [key, value] = args;
127128
if (key === 'birthdate') {
128129
value = this.formatBirthdate(value);
129-
} else if (key === 'location') {
130-
value = this.processLocation(value);
131130
}
132131
this.userData[key] = value;
133132
this.nextSlide();
@@ -137,9 +136,10 @@ export default {
137136
this.slideCurrent += 1;
138137
await this.bus.$emit('sendUserLocationToBackend');
139138
await this.$http.post('/profile/complete', this.userData);
140-
await this.$http.get('/recommendations');
139+
const recommendationsRequest = await this.$http.get('/recommendations');
140+
const recommendationsFromSettingUp = recommendationsRequest.data.recommendations;
141141
await this.$store.dispatch('profileCompleted');
142-
await this.$router.push('/browse');
142+
await this.$router.push({ name: Browse, params: { recommendationsFromSettingUp } });
143143
}
144144
if (this.slideCurrent < this.slideCount) {
145145
if (this.slideCurrent === 4 && this.userUploadedImagesCount) {
@@ -157,16 +157,9 @@ export default {
157157
return ages;
158158
},
159159
formatBirthdate(age) {
160-
let birthyear = new Date().getFullYear() - age;
161-
return '01/01/' + birthyear;
160+
const birthyear = new Date().getFullYear() - age;
161+
return `01/01/${birthyear}`;
162162
},
163-
processLocation(allowAccessToLocation) {
164-
if (allowAccessToLocation) {
165-
navigator.geolocation.getCurrentPosition(function(position) {
166-
console.log(position.coords.latitude + position.coords.longitude);
167-
});
168-
}
169-
}
170163
},
171164
computed: {
172165
buttonText() {

0 commit comments

Comments
 (0)