Update deps and fix some front-end stuff
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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]],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user