mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-23 17:02:55 -04:00
feat: Add Alerts for Ingredient Parsing Errors (#3795)
This commit is contained in:
parent
477899fce3
commit
5e0f8a4bf7
@ -64,6 +64,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, reactive, ref, toRefs, useContext } from "@nuxtjs/composition-api";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { IngredientConfidence } from "~/lib/api/types/recipe";
|
||||
import { Parser } from "~/lib/api/user/recipes/recipe";
|
||||
@ -161,6 +162,9 @@ export default defineComponent({
|
||||
properties[property].confidence = confidence;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert.error(i18n.t("events.something-went-wrong") as string);
|
||||
state.results = false;
|
||||
}
|
||||
state.loading = false;
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ import { computed, defineComponent, ref, useContext, useRoute, useRouter, watch
|
||||
import { invoke, until } from "@vueuse/core";
|
||||
import draggable from "vuedraggable";
|
||||
import RecipeIngredientEditor from "~/components/Domain/Recipe/RecipeIngredientEditor.vue";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
import { useAppInfo, useUserApi } from "~/composables/api";
|
||||
import { useRecipe } from "~/composables/recipes";
|
||||
import { useFoodData, useFoodStore, useUnitData, useUnitStore } from "~/composables/store";
|
||||
@ -239,6 +240,9 @@ export default defineComponent({
|
||||
errors.value = data.map((ing, index: number) => {
|
||||
return processIngredientError(ing, index);
|
||||
});
|
||||
} else {
|
||||
alert.error(i18n.t("events.something-went-wrong") as string);
|
||||
parsedIng.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user