Fix js warnings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-01-24 15:57:45 +01:00
parent c660210439
commit b264a49c23
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 14 additions and 15 deletions

View file

@ -28,7 +28,7 @@
</router-link>
<router-link
class="button is-light"
v-if="currentUser.id"
v-if="currentUser.id && loggedPerson"
:to="{ name: 'Profile', params: { name: loggedPerson.preferredUsername} }"
>
<figure class="image is-24x24">
@ -43,27 +43,27 @@
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
import { AUTH_USER_ACTOR } from '@/constants';
import { SEARCH } from '@/graphql/search';
import { CURRENT_USER_CLIENT } from '@/graphql/user';
import { onLogout } from '@/vue-apollo';
import { deleteUserData } from '@/utils/auth';
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
import { AUTH_USER_ACTOR } from "@/constants";
import { SEARCH } from "@/graphql/search";
import { CURRENT_USER_CLIENT } from "@/graphql/user";
import { onLogout } from "@/vue-apollo";
import { deleteUserData } from "@/utils/auth";
import { LOGGED_PERSON } from "@/graphql/actor";
import { IPerson } from "../types/actor.model";
@Component({
@Component({
apollo: {
search: {
query: SEARCH,
variables() {
return {
searchText: this.searchText,
searchText: this.searchText
};
},
skip() {
return !this.searchText;
},
}
},
currentUser: {
query: CURRENT_USER_CLIENT
@ -71,7 +71,7 @@ import { IPerson } from "../types/actor.model";
loggedPerson: {
query: LOGGED_PERSON
}
},
}
})
export default class NavBar extends Vue {
notifications = [
@ -128,12 +128,11 @@ export default class NavBar extends Vue {
}
logout() {
alert('logout !');
alert("logout !");
deleteUserData();
return onLogout(this.$apollo);
}
}
</script>

View file

@ -1,6 +1,6 @@
<template>
<div>
<section class="hero is-link" v-if="!currentUser.id">
<section class="hero is-link" v-if="!currentUser.id || !loggedPerson">
<div class="hero-body">
<div class="container">
<h1 class="title">Find events you like</h1>
@ -43,7 +43,7 @@ import { FETCH_EVENTS } from "@/graphql/event";
import { Component, Vue } from "vue-property-decorator";
import EventCard from "@/components/Event/EventCard.vue";
import { LOGGED_PERSON } from "@/graphql/actor";
import { IPerson } from "../types/actor.model";
import { IPerson } from "@/types/actor.model";
import { ICurrentUser } from "@/types/current-user.model";
import { CURRENT_USER_CLIENT } from "@/graphql/user";