Improve method signatures

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-09-22 10:37:16 +02:00
parent 07c1c0ed7e
commit 4ac7ed7e0e
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -160,7 +160,7 @@ export default class NavBar extends Vue {
mobileNavbarActive = false; mobileNavbarActive = false;
@Watch("currentActor") @Watch("currentActor")
async initializeListOfIdentities() { async initializeListOfIdentities(): Promise<void> {
if (!this.currentUser.isLoggedIn) return; if (!this.currentUser.isLoggedIn) return;
const { data } = await this.$apollo.query<{ identities: IPerson[] }>({ const { data } = await this.$apollo.query<{ identities: IPerson[] }>({
query: IDENTITIES, query: IDENTITIES,
@ -182,7 +182,7 @@ export default class NavBar extends Vue {
} }
} }
async handleErrors(errors: GraphQLError[]) { async handleErrors(errors: GraphQLError[]): Promise<void> {
if ( if (
errors.length > 0 && errors.length > 0 &&
errors[0].message === "You need to be logged-in to view your list of identities" errors[0].message === "You need to be logged-in to view your list of identities"
@ -191,7 +191,7 @@ export default class NavBar extends Vue {
} }
} }
async logout() { async logout(): Promise<void> {
await logout(this.$apollo.provider.defaultClient); await logout(this.$apollo.provider.defaultClient);
this.$buefy.notification.open({ this.$buefy.notification.open({
message: this.$t("You have been disconnected") as string, message: this.$t("You have been disconnected") as string,
@ -204,7 +204,7 @@ export default class NavBar extends Vue {
await this.$router.push({ name: RouteName.HOME }); await this.$router.push({ name: RouteName.HOME });
} }
async setIdentity(identity: IPerson) { async setIdentity(identity: IPerson): Promise<void> {
await this.$apollo.mutate({ await this.$apollo.mutate({
mutation: UPDATE_DEFAULT_ACTOR, mutation: UPDATE_DEFAULT_ACTOR,
variables: { variables: {