Skip to content

Commit

Permalink
[ICIJ/datashare#399] Fix refresh graph on index change
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Mar 23, 2020
1 parent 3234893 commit 832da55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/WidgetCreationDateOverTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ export default {
},
watch: {
index () {
this.$set(this, 'mounted', false)
this.init()
}
},
mounted () {
this.$nextTick(() => this.init())
},
computed: {
...mapState('search', ['index']),
...mapState('insights', ['index']),
container () {
return this.mounted ? this.$el.querySelector('.widget__content__chart') : null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('WidgetCreationDateOverTime.vue', () => {
const init = jest.spyOn(wrapper.vm, 'init')
await wrapper.vm.$nextTick()
expect(init).toBeCalledTimes(1)
await store.commit('search/index', anotherIndex)
await store.commit('insights/index', anotherIndex)
expect(init).toBeCalledTimes(2)
})

Expand Down

0 comments on commit 832da55

Please sign in to comment.