added plural migration and pass param trough in recipe view

This commit is contained in:
vabene1111
2022-11-22 07:58:12 +01:00
parent f92ee32c01
commit 39ccf7bbcf
5 changed files with 57 additions and 6 deletions

View File

@@ -90,6 +90,7 @@
:ingredient_factor="ingredient_factor"
:servings="servings"
:header="true"
:use_plural="use_plural"
id="ingredient_container"
@checked-state-changed="updateIngredientCheckedState"
@change-servings="servings = $event"
@@ -123,6 +124,7 @@
:step="s"
:ingredient_factor="ingredient_factor"
:index="index"
:use_plural="use_plural"
:start_time="start_time"
@update-start-time="updateStartTime"
@checked-state-changed="updateIngredientCheckedState"
@@ -179,6 +181,7 @@ import KeywordsComponent from "@/components/KeywordsComponent"
import NutritionComponent from "@/components/NutritionComponent"
import RecipeSwitcher from "@/components/Buttons/RecipeSwitcher"
import CustomInputSpinButton from "@/components/CustomInputSpinButton"
import {ApiApiFactory} from "@/utils/openapi/api";
Vue.prototype.moment = moment
@@ -218,6 +221,7 @@ export default {
},
data() {
return {
use_plural: false,
loading: true,
recipe: undefined,
rootrecipe: undefined,
@@ -226,7 +230,7 @@ export default {
start_time: "",
share_uid: window.SHARE_UID,
wake_lock: null,
ingredient_height: '250'
ingredient_height: '250',
}
},
watch: {
@@ -239,6 +243,11 @@ export default {
this.$i18n.locale = window.CUSTOM_LOCALE
this.requestWakeLock()
window.addEventListener('resize', this.handleResize);
let apiClient = new ApiApiFactory()
apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => {
this.use_plural = r.data.use_plural
})
},
beforeUnmount() {
this.destroyWakeLock()