Skip to content

Commit

Permalink
Update import data structure.
Browse files Browse the repository at this point in the history
Remove obsolete and redundant budget.budget structure
Move budget to settings object.
  • Loading branch information
Delwin444 committed Sep 5, 2021
1 parent ed0d41a commit 322a8ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/calculator/Export.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default {
const exportData = {
positions: this.$store.getters['positions/valid'],
groups: this.$store.state.groups.items,
budget: this.$store.state.controls.budget.budget,
settings: {
enableAnimations: this.$store.state.controls.enableAnimations
enableAnimations: this.$store.state.controls.enableAnimations,
budget: this.$store.state.controls.budget
}
}
const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(exportData))
Expand Down
5 changes: 2 additions & 3 deletions src/components/calculator/Import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export default {
const requiredImportDataKeys = [
'groups',
'positions',
'settings',
'budget'
'settings'
]
pseudoImportNode.type = 'file'
pseudoImportNode.accept = '.json'
Expand Down Expand Up @@ -56,7 +55,7 @@ export default {
self.$store.commit('groups/update', importData.groups)
self.$store.commit('positions/update', importData.positions)
self.$store.commit('controls/updateEnableAnimations', importData.settings.enableAnimations)
self.$store.commit('controls/updateBudget', importData.budget)
self.$store.commit('controls/updateBudget', importData.settings.budget)
})
fileReader.readAsText(file)
Expand Down

0 comments on commit 322a8ba

Please sign in to comment.