fix: Don't hit authenticated endpoints when logged out (#7563)

This commit is contained in:
garlic-hub
2026-04-29 21:21:48 -07:00
committed by GitHub
parent f354f12853
commit 5b37eb012c
4 changed files with 18 additions and 8 deletions

View File

@@ -6,8 +6,13 @@ const loading = ref(false);
export const useHouseholdSelf = function () {
const api = useUserApi();
const auth = useMealieAuth();
async function refreshHouseholdSelf() {
if (!auth.user.value) {
householdSelfRef.value = null;
return;
}
loading.value = true;
const { data } = await api.households.getCurrentUserHousehold();
householdSelfRef.value = data;