mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-15 04:13:11 -05: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 };
|
|
};
|