Skip to content

Commit a5869d5

Browse files
committed
setting up screen
1 parent ce63b59 commit a5869d5

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

frontend/src/assets/loading.svg

Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<section class="onboarding-sub-container relative">
3+
<h1
4+
class="onboarding-sub-container-content-heading text-5xl leading-none text-center">
5+
Setting up<br>account
6+
</h1>
7+
<img class="mt-4 h-32" src='../../../assets/loading.svg'>
8+
</section>
9+
</template>

frontend/src/views/app/Onboarding.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
key: 'bio',
7575
current: slideCurrent,
7676
count: slideCount,
77-
minTextareaLength: 50,
77+
minTextareaLength: 51,
7878
maxTextareaLength: 200,
7979
placeholder: 'I am best described as ...',
8080
buttonText}"
@@ -88,6 +88,7 @@
8888
buttonText}"
8989
v-on:nextSlide="nextSlide"
9090
v-if="slideCurrent === 7"></Location>
91+
<SettingUp v-if="slideCurrent === 8"></SettingUp>
9192
</div>
9293
</template>
9394

@@ -98,7 +99,8 @@ import SingleChoice from '@/components/app/onboarding/SingleChoice.vue';
9899
import MultipleChoice from '@/components/app/onboarding/MultipleChoice.vue';
99100
import MainAndSecondaryImagesUpload from '@/components/app/onboarding/MainAndSecondaryImagesUpload.vue';
100101
import Textblock from '@/components/app/onboarding/Textblock.vue';
101-
import Location from "@/components/app/onboarding/Location";
102+
import Location from "@/components/app/onboarding/Location.vue";
103+
import SettingUp from "@/components/app/onboarding/SettingUp.vue";
102104
103105
export default {
104106
components: {
@@ -108,11 +110,13 @@ export default {
108110
MainAndSecondaryImagesUpload,
109111
Textblock,
110112
Location,
113+
SettingUp,
111114
},
112115
data: () => ({
113116
slideCurrent: 0,
114117
slideCount: 7,
115118
userData: {},
119+
userUploadedImagesCount: 0,
116120
}),
117121
methods: {
118122
saveInput(...args) {
@@ -127,13 +131,18 @@ export default {
127131
},
128132
async nextSlide() {
129133
if (this.slideCurrent === this.slideCount) {
134+
this.slideCurrent += 1;
130135
await this.$http.post('/profile/complete', this.userData);
136+
await this.$http.get('/recommendations');
131137
await this.$store.dispatch('profileCompleted');
132-
console.log('setting up profile might take a while');
133-
// await this.$router.push('/browse');
138+
await this.$router.push('/browse');
134139
}
135140
if (this.slideCurrent < this.slideCount) {
136-
this.slideCurrent += 1;
141+
if (this.slideCurrent === 4 && this.userUploadedImagesCount) {
142+
this.slideCurrent += 2;
143+
} else {
144+
this.slideCurrent += 1;
145+
}
137146
}
138147
},
139148
generateAllowedAge() {
@@ -166,6 +175,11 @@ export default {
166175
return 'Finish';
167176
},
168177
},
178+
async beforeMount() {
179+
const response = await this.$http.get('/profile/images');
180+
const { images } = response.data;
181+
this.userUploadedImagesCount = images.length;
182+
},
169183
};
170184
171185
</script>

0 commit comments

Comments
 (0)