diff --git a/flatisfy/web/js_src/views/home.vue b/flatisfy/web/js_src/views/home.vue
index 4bfc8be..bfa2d5d 100644
--- a/flatisfy/web/js_src/views/home.vue
+++ b/flatisfy/web/js_src/views/home.vue
@@ -2,7 +2,13 @@
-
{{ $t("home.new_available_flats") }}
+
+ {{ $t("home.new_available_flats") }}
+
+
@@ -12,7 +18,7 @@
- {{ postal_code_data.flats.length }} {{ $tc("common.flats", postal_code_data.flats.length) }}
-
+
@@ -43,12 +49,24 @@ export default {
this.$store.dispatch('getAllTimeToPlaces')
},
+ data () {
+ return {
+ showExpiredFlats: false,
+ };
+ },
+
computed: {
postalCodesFlatsBuckets () {
- return this.$store.getters.postalCodesFlatsBuckets(flat => flat.status === 'new')
+ return this.$store.getters.postalCodesFlatsBuckets(flat =>
+ flat.status === 'new' &&
+ (this.showExpiredFlats || !flat.is_expired)
+ )
},
flatsMarkers () {
- return this.$store.getters.flatsMarkers(this.$router, flat => flat.status === 'new')
+ return this.$store.getters.flatsMarkers(this.$router, flat =>
+ flat.status === 'new' &&
+ (this.showExpiredFlats || !flat.is_expired)
+ )
},
timeToPlaces () {
return this.$store.getters.allTimeToPlaces
@@ -59,3 +77,15 @@ export default {
}
}
+
+