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}"
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';
9899import MultipleChoice from ' @/components/app/onboarding/MultipleChoice.vue' ;
99100import MainAndSecondaryImagesUpload from ' @/components/app/onboarding/MainAndSecondaryImagesUpload.vue' ;
100101import 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
103105export 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