1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 23:59:45 +02:00

fix: duplicate network calls on index page (#2085)

* Prevent extra recipe load on index page

* Prevent loading recipes with food for all components but search ones

* add missing change in search page
This commit is contained in:
Sören 2023-02-05 19:52:49 +01:00 committed by GitHub
parent f3a26f864d
commit f4b819899d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 4 deletions

View file

@ -183,6 +183,10 @@ export default defineComponent({
type: String,
default: null,
},
skipLoad: {
type: Boolean,
default: false
}
},
setup(props, context) {
const preferences = useUserSortPreferences();
@ -233,6 +237,9 @@ export default defineComponent({
const { fetchMore } = useLazyRecipes();
onMounted(async () => {
if (props.skipLoad) {
return;
}
const newRecipes = await fetchMore(
page.value,

View file

@ -65,7 +65,7 @@ export default defineComponent({
},
setup(_, context) {
const { refreshRecipes } = useRecipes(true, false);
const { refreshRecipes } = useRecipes(true, false, true);
const state = reactive({
loading: false,