diff --git a/CHANGELOG.md b/CHANGELOG.md
index e4d408ef8..89000fdcf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
## [Unreleased]
+### Fixed
+- Calling reindex
+ [#653](https://github.com/nextcloud/cookbook/pull/653) @seyfeb
+- Setting nutrition information on recipes with an array assigned for nutrition
+ [#653](https://github.com/nextcloud/cookbook/pull/653) @seyfeb
+
## 0.8.4 - 2021-03-08
### Added
diff --git a/src/components/AppSettings.vue b/src/components/AppSettings.vue
index 9791b0da3..973cb8190 100644
--- a/src/components/AppSettings.vue
+++ b/src/components/AppSettings.vue
@@ -12,7 +12,7 @@
: 'icon-history'
"
:title="t('cookbook', 'Rescan library')"
- @click="emit('reindex')"
+ @click="$emit('reindex')"
/>
diff --git a/src/components/EditMultiselectInputGroup.vue b/src/components/EditMultiselectInputGroup.vue
index a833b2f31..b16683c7c 100644
--- a/src/components/EditMultiselectInputGroup.vue
+++ b/src/components/EditMultiselectInputGroup.vue
@@ -82,7 +82,7 @@ export default {
// Value (passed in v-model)
value: {
type: Object,
- default: () => ({}),
+ default: () => {},
required: true,
},
},
diff --git a/src/components/RecipeEdit.vue b/src/components/RecipeEdit.vue
index d6fed87f8..597d28f64 100644
--- a/src/components/RecipeEdit.vue
+++ b/src/components/RecipeEdit.vue
@@ -541,12 +541,6 @@ export default {
)
.then((response) => {
const recipe = response.data
- if (
- "nutrition" in recipe &&
- recipe.nutrition instanceof Array
- ) {
- recipe.nutrition = {}
- }
$this.$store.dispatch("setRecipe", { recipe })
$this.setup()
})
diff --git a/src/store/index.js b/src/store/index.js
index f631fb139..58c55ff4b 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -62,7 +62,12 @@ export default new Vuex.Store({
state.page = p
},
setRecipe(state, { r }) {
- state.recipe = r
+ const rec = JSON.parse(JSON.stringify(r))
+ if ("nutrition" in rec && rec.nutrition instanceof Array) {
+ rec.nutrition = {}
+ }
+ state.recipe = rec
+
// Setting recipe also means that loading/reloading the recipe has finished
state.loadingRecipe = 0
state.reloadingRecipe = 0