fix(front-end): fix current actor not being set on first access when relogging

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-12-12 11:39:27 +01:00
parent 820d4adb69
commit ae466b879c
4 changed files with 35 additions and 30 deletions

View File

@@ -6,7 +6,7 @@ import {
} from "@/graphql/actor";
import { IPerson } from "@/types/actor";
import { ICurrentUser } from "@/types/current-user.model";
import { useQuery } from "@vue/apollo-composable";
import { useLazyQuery, useQuery } from "@vue/apollo-composable";
import { computed, Ref, unref } from "vue";
import { useCurrentUserClient } from "./user";
@@ -22,6 +22,12 @@ export function useCurrentActorClient() {
return { currentActor, error, loading };
}
export function useLazyCurrentUserIdentities() {
return useLazyQuery<{
loggedUser: Pick<ICurrentUser, "actors">;
}>(IDENTITIES);
}
export function useCurrentUserIdentities() {
const { currentUser } = useCurrentUserClient();