fix: user fetching for tags

This commit is contained in:
Ron 2025-03-14 02:44:02 +02:00
parent 9c54174f9d
commit 28350228e2
1 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,5 @@
export const usePortalTags = () => {
const { fetchUser, setUser } = useDirectusAuth();
const user = useDirectusUser();
const tags = computed(() => (toValue(user)?.tags as Array<string>) || []);
@ -11,5 +12,12 @@ export const usePortalTags = () => {
};
});
onBeforeMount(async () => {
if (!user.value) {
const user = await fetchUser();
setUser(user.value);
}
});
return details;
};