mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Make sure only future events are shown on homepage
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
5ebbb57d0e
commit
4d8bad7088
1 changed files with 5 additions and 2 deletions
|
@ -117,6 +117,7 @@ import { IConfig } from '@/types/config.model';
|
|||
events: {
|
||||
query: FETCH_EVENTS,
|
||||
fetchPolicy: 'no-cache', // Debug me: https://github.com/apollographql/apollo-client/issues/3030
|
||||
update: data => data.events.map(event => new EventModel(event)),
|
||||
},
|
||||
currentActor: {
|
||||
query: CURRENT_ACTOR_CLIENT,
|
||||
|
@ -250,8 +251,10 @@ export default class Home extends Vue {
|
|||
}
|
||||
|
||||
get filteredFeaturedEvents() {
|
||||
if (!this.currentUser.isLoggedIn || !this.currentActor.id) return this.events;
|
||||
return this.events.filter(event => event.organizerActor && event.organizerActor.id !== this.currentActor.id);
|
||||
if (!this.currentUser.isLoggedIn || !this.currentActor.id) return this.events.filter((event: IEvent) => event.beginsOn > new Date());
|
||||
return this.events.filter(event => event.organizerActor &&
|
||||
event.organizerActor.id !== this.currentActor.id &&
|
||||
event.beginsOn > new Date());
|
||||
}
|
||||
|
||||
geoLocalize() {
|
||||
|
|
Loading…
Reference in a new issue