Remove own current identity events from featured events

Events from other identities are still displayed

Closes #187

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-08 19:41:14 +02:00
parent f99586c897
commit 949785ed5b
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -30,7 +30,7 @@
{{ $t('Welcome back {username}', { username: currentActor.displayName() }) }}
</b-message>
</section>
<section v-if="currentActor && goingToEvents.size > 0" class="container">
<section v-if="currentActor.id && goingToEvents.size > 0" class="container">
<h3 class="title">
{{ $t("Upcoming") }}
</h3>
@ -81,8 +81,8 @@
<section class="events-featured">
<h3 class="title">{{ $t('Featured events') }}</h3>
<b-loading :active.sync="$apollo.loading"></b-loading>
<div v-if="events.length > 0" class="columns is-multiline">
<div class="column is-one-third-desktop" v-for="event in events.slice(0, 6)" :key="event.uuid">
<div v-if="filteredFeaturedEvents.length > 0" class="columns is-multiline">
<div class="column is-one-third-desktop" v-for="event in filteredFeaturedEvents.slice(0, 6)" :key="event.uuid">
<EventCard
:event="event"
/>
@ -224,6 +224,11 @@ export default class Home extends Vue {
return res;
}
get filteredFeaturedEvents() {
if (this.currentUser.isLoggedIn === false || !this.currentActor.id) return this.events;
return this.events.filter(event => event.organizerActor.id !== this.currentActor.id);
}
geoLocalize() {
const router = this.$router;
const sessionCity = sessionStorage.getItem('City');