Skip to content

Commit

Permalink
Merge pull request #653 from nextcloud/issues/652nutrition
Browse files Browse the repository at this point in the history
Fix reindexing and editing nutrition information
  • Loading branch information
seyfeb authored Mar 12, 2021
2 parents acb59c1 + 7c2cdd9 commit c2ccb3c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
: 'icon-history'
"
:title="t('cookbook', 'Rescan library')"
@click="emit('reindex')"
@click="$emit('reindex')"
/>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditMultiselectInputGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default {
// Value (passed in v-model)
value: {
type: Object,
default: () => ({}),
default: () => {},
required: true,
},
},
Expand Down
6 changes: 0 additions & 6 deletions src/components/RecipeEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
7 changes: 6 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2ccb3c

Please sign in to comment.