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 89c7a3854b
commit 4f487c84ae

View File

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