mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-11 07:25:42 -04:00
chore: Nuxt 4 upgrade (#7426)
This commit is contained in:
16
frontend/app/composables/use-logged-in-state.ts
Normal file
16
frontend/app/composables/use-logged-in-state.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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 };
|
||||
};
|
||||
Reference in New Issue
Block a user