Update deps and fix some front-end stuff

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-03-17 19:06:46 +01:00
parent 8984bd7636
commit 59944603b7
17 changed files with 668 additions and 559 deletions

View File

@@ -25,16 +25,14 @@ export function useCurrentActorClient() {
export function useCurrentUserIdentities() {
const { currentUser } = useCurrentUserClient();
const { result, error, loading } = useQuery<{ loggedUser: Pick<ICurrentUser, 'actors'> }>(
IDENTITIES,
{},
() => ({
enabled:
currentUser.value?.id !== undefined &&
currentUser.value?.id !== null &&
currentUser.value?.isLoggedIn === true,
})
);
const { result, error, loading } = useQuery<{
loggedUser: Pick<ICurrentUser, "actors">;
}>(IDENTITIES, {}, () => ({
enabled:
currentUser.value?.id !== undefined &&
currentUser.value?.id !== null &&
currentUser.value?.isLoggedIn === true,
}));
const identities = computed(() => result.value?.loggedUser?.actors);
return { identities, error, loading };

View File

@@ -82,7 +82,9 @@ export function registerAccount() {
{ context }
) => {
if (context?.userAlreadyActivated) {
const currentUserData = store.readQuery<{ loggedUser: Pick<ICurrentUser, 'actors'> }>({
const currentUserData = store.readQuery<{
loggedUser: Pick<ICurrentUser, "actors">;
}>({
query: IDENTITIES,
});
@@ -96,9 +98,7 @@ export function registerAccount() {
query: IDENTITIES,
data: {
...currentUserData.loggedUser,
actors: [
[...currentUserData.loggedUser.actors, newPersonData]
]
actors: [[...currentUserData.loggedUser.actors, newPersonData]],
},
});
}