1111 v-bind:recommendationsReceived =" recommendations"
1212 v-bind:recommendationsAnalysis =" filters" ></Recommendations >
1313 </section >
14- <section v-if =" !recommendationsAnalysisDone && sliderValuesFetched" class =" flex flex-col my-8 md:my-12" >
14+ <section v-on:click =" setError(null)"
15+ v-if =" !recommendationsAnalysisDone && sliderValuesFetched"
16+ class =" flex flex-col my-8 md:my-12" >
17+ <div ><img src =" ../../assets/search.png" class =" w-20 mb-4 mx-auto" ></div >
1518 <div >
1619 <FilterSlider
1720 v-bind:min =" sliders.age.min"
4649 'astrology', 'board games', 'craft beer', 'coffee', 'writer',
4750 ]"
4851 v-bind:name =" 'interests'"
52+ v-bind:info =" 'If no selected, all are accounted.'"
4953 v-on:saveFilterMultiple =" saveFilterMultiple" ></MultipleFilters >
5054 </div >
55+ <div class =" auth-sub-container-error mx-auto max-w-md" v-if =" error" ><h1 class =" auth-sub-container-error-message" >{{ error }}</h1 ></div >
5156 <div class =" mx-auto w-full max-w-md" >
5257 <h1 v-on:click =" search()" class =" onboarding-sub-container-content-button-outline w-48 text-lg font-normal max-w-full bg-purple-matcha w-full text-white-matcha mx-auto" >
5358 Search</h1 >
@@ -99,6 +104,7 @@ export default {
99104 interests: [],
100105 },
101106 recommendationsAnalysisDone: false ,
107+ error: null ,
102108 }),
103109 methods: {
104110 saveFilter (... range ) {
@@ -137,6 +143,10 @@ export default {
137143 ];
138144 }
139145 this .recommendations = searchRequest .data .search_results ;
146+ if (this .recommendations .length === 0 ) {
147+ this .setError (' 0 profiles found. Please, try expanding your search criteria.' );
148+ return ;
149+ }
140150 this .recommendations .sort ((a , b ) => a .distance - b .distance );
141151 for (let i = 0 ; i < this .recommendations .length ; i += 1 ) {
142152 if (this .recommendations [i].age < 18 ) {
@@ -150,10 +160,23 @@ export default {
150160 }
151161 }
152162 this .recommendationsAnalysisDone = true ;
163+ this .scrollToTop ();
153164 },
154165 searchAgain () {
166+ this .filters .age .min = null ;
167+ this .filters .age .max = null ;
168+ this .filters .popularity .min = null ;
169+ this .filters .popularity .max = null ;
170+ this .filters .distance .max = null ;
171+ this .filters .interests = [];
155172 this .recommendationsAnalysisDone = false ;
156173 },
174+ setError (message ) {
175+ this .error = message;
176+ },
177+ scrollToTop () {
178+ window .scrollTo (0 , 0 );
179+ },
157180 },
158181 async mounted () {
159182 const sliderRangesRequest = await this .$http .get (' /search/values' );
0 commit comments