2e9026f9ea
* feat(frontend): 💄 add recipe title * fix(frontend): 🐛 fixes #722 side-bar issue * feat(frontend): ✨ Add page titles to all pages * minor cleanup * refactor(backend): ♻️ rewrite scheduler to be more modulare and work * feat(frontend): ✨ start password reset functionality * refactor(backend): ♻️ refactor application settings to facilitate dependency injection * refactor(backend): 🔥 remove RECIPE_SETTINGS env variables in favor of group settings * formatting * refactor(backend): ♻️ align naming convention * feat(backend): ✨ password reset * test(backend): ✅ password reset * feat(frontend): ✨ self-service password reset * purge password schedule * update user creation for tests Co-authored-by: Hayden <hay-kot@pm.me>
57 lines
No EOL
1.5 KiB
Vue
57 lines
No EOL
1.5 KiB
Vue
<template>
|
|
<v-container>
|
|
<RecipeCardSection
|
|
:icon="$globals.icons.primary"
|
|
:title="$t('page.all-recipes')"
|
|
:recipes="recipes"
|
|
></RecipeCardSection>
|
|
<v-card v-intersect="infiniteScroll"></v-card>
|
|
<v-fade-transition>
|
|
<AppLoader v-if="loading" :loading="loading" />
|
|
</v-fade-transition>
|
|
</v-container>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, onMounted, ref } from "@nuxtjs/composition-api";
|
|
import { useThrottleFn } from "@vueuse/core";
|
|
import RecipeCardSection from "~/components/Domain/Recipe/RecipeCardSection.vue";
|
|
import { useLazyRecipes } from "~/composables/use-recipes";
|
|
|
|
export default defineComponent({
|
|
components: { RecipeCardSection },
|
|
setup() {
|
|
const start = ref(1);
|
|
const limit = ref(30);
|
|
const increment = ref(30);
|
|
const ready = ref(false);
|
|
const loading = ref(false);
|
|
|
|
const { recipes, fetchMore } = useLazyRecipes();
|
|
|
|
onMounted(async () => {
|
|
await fetchMore(start.value, limit.value);
|
|
ready.value = true;
|
|
});
|
|
|
|
const infiniteScroll = useThrottleFn(() => {
|
|
if (!ready.value) {
|
|
return;
|
|
}
|
|
loading.value = true;
|
|
start.value = limit.value + 1;
|
|
limit.value = limit.value + increment.value;
|
|
fetchMore(start.value, limit.value);
|
|
loading.value = false;
|
|
}, 500);
|
|
|
|
return { recipes, infiniteScroll, loading };
|
|
},
|
|
head() {
|
|
return {
|
|
title: this.$t("page.all-recipes") as string,
|
|
};
|
|
},
|
|
});
|
|
</script>
|
|
|