File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
frontend/src/components/app/recommendations Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,20 @@ export default {
147147 }
148148 return true ;
149149 },
150+ filterOutBlockedUsers (recommendations ) {
151+ let i = recommendations .length ;
152+ const { blocks } = this .$store .getters .getLoggedInUser ;
153+ let blockedIds = [];
154+ for (let j = 0 ; j < blocks .length ; j += 1 ) {
155+ blockedIds .push (blocks[j].blocked_id );
156+ }
157+ while (i-- ) {
158+ if (blockedIds .indexOf (recommendations[i].id ) !== - 1 ) {
159+ recommendations .splice (i, 1 );
160+ }
161+ }
162+ return recommendations;
163+ },
150164 },
151165 watch: {
152166 sorting: {
@@ -165,8 +179,8 @@ export default {
165179 }
166180 },
167181 beforeMount () {
168- this .recommendations = this .recommendationsReceived ;
169- this .recommendationsBackup = this .recommendationsReceived ;
182+ this .recommendations = this .filterOutBlockedUsers ( this . recommendationsReceived ) ;
183+ this .recommendationsBackup = this .recommendations ;
170184 this .filters .age .min = this .recommendationsAnalysis .age .min ;
171185 this .filters .age .max = this .recommendationsAnalysis .age .max ;
172186 this .filters .distance .min = this .recommendationsAnalysis .distance .min ;
You can’t perform that action at this time.
0 commit comments