mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-05-14 13:57: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<MultiPurposeLabelOut[]> = ref([]);
|
||||
const loading = ref(false);
|
||||
const initialized = ref(false);
|
||||
|
||||
export function resetLabelStore() {
|
||||
store.value = [];
|
||||
loading.value = false;
|
||||
initialized.value = false;
|
||||
}
|
||||
|
||||
export const useLabelData = function () {
|
||||
@@ -22,5 +24,5 @@ export const useLabelData = function () {
|
||||
|
||||
export const useLabelStore = function (i18n?: Composer) {
|
||||
const api = useUserApi(i18n);
|
||||
return useStore<MultiPurposeLabelOut>("label", store, loading, api.multiPurposeLabels);
|
||||
return useStore<MultiPurposeLabelOut>("label", store, loading, initialized, api.multiPurposeLabels);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user