mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-05 20:45:34 -04:00
17 lines
419 B
TypeScript
17 lines
419 B
TypeScript
export const useLoggedInState = function () {
|
|
const auth = useMealieAuth();
|
|
const route = useRoute();
|
|
|
|
const loggedIn = computed(() => auth.loggedIn.value);
|
|
const isOwnGroup = computed(() => {
|
|
if (!route.params.groupSlug) {
|
|
return loggedIn.value;
|
|
}
|
|
else {
|
|
return loggedIn.value && auth.user.value?.groupSlug === route.params.groupSlug;
|
|
}
|
|
});
|
|
|
|
return { loggedIn, isOwnGroup };
|
|
};
|