mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-05-13 13:27:29 -04:00
fix: Infinite API request loop on empty stores (#7613)
This commit is contained in:
@@ -5,10 +5,12 @@ import { useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<IngredientUnit[]> = ref([]);
|
||||
const loading = ref(false);
|
||||
const initialized = ref(false);
|
||||
|
||||
export function resetUnitStore() {
|
||||
store.value = [];
|
||||
loading.value = false;
|
||||
initialized.value = false;
|
||||
}
|
||||
|
||||
export const useUnitData = function () {
|
||||
@@ -23,5 +25,5 @@ export const useUnitData = function () {
|
||||
|
||||
export const useUnitStore = function (i18n?: Composer) {
|
||||
const api = useUserApi(i18n);
|
||||
return useStore<IngredientUnit>("unit", store, loading, api.units);
|
||||
return useStore<IngredientUnit>("unit", store, loading, initialized, api.units);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user