only show create/import on search when not loading
This commit is contained in:
@ -845,7 +845,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 d-none d-md-block"></div>
|
<div class="col-md-2 d-none d-md-block"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-if="recipes.length < 1 && !recipes_loading">
|
||||||
<div class="row mt-5">
|
<div class="row mt-5">
|
||||||
<div class="col col-md-12 text-center">
|
<div class="col col-md-12 text-center">
|
||||||
<h4 class="text-muted"><i class="far fa-eye"></i> {{ $t('search_no_recipes') }}</h4>
|
<h4 class="text-muted"><i class="far fa-eye"></i> {{ $t('search_no_recipes') }}</h4>
|
||||||
@ -918,6 +918,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// this.Models and this.Actions inherited from ApiMixin
|
// this.Models and this.Actions inherited from ApiMixin
|
||||||
recipes: [],
|
recipes: [],
|
||||||
|
recipes_loading: true,
|
||||||
facets: {Books: [], Foods: [], Keywords: []},
|
facets: {Books: [], Foods: [], Keywords: []},
|
||||||
meal_plans: [],
|
meal_plans: [],
|
||||||
last_viewed_recipes: [],
|
last_viewed_recipes: [],
|
||||||
@ -1200,6 +1201,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// this.genericAPI inherited from ApiMixin
|
// this.genericAPI inherited from ApiMixin
|
||||||
refreshData: _debounce(function (random) {
|
refreshData: _debounce(function (random) {
|
||||||
|
this.recipes_loading = true
|
||||||
let params = this.buildParams(random)
|
let params = this.buildParams(random)
|
||||||
this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params)
|
this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
@ -1214,6 +1216,7 @@ export default {
|
|||||||
this.meal_plans.forEach((x) => mealPlans.push(x.recipe.id))
|
this.meal_plans.forEach((x) => mealPlans.push(x.recipe.id))
|
||||||
this.recipes = this.recipes.filter((recipe) => !mealPlans.includes(recipe.id))
|
this.recipes = this.recipes.filter((recipe) => !mealPlans.includes(recipe.id))
|
||||||
}
|
}
|
||||||
|
this.recipes_loading = false
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
|
Reference in New Issue
Block a user