Skip to content

Commit

Permalink
feat(webui): refresh browse collection screen on action menu actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Jun 26, 2020
1 parent 15f9c82 commit 8f2c453
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion komga-webui/src/views/BrowseCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import CollectionEditDialog from '@/components/CollectionEditDialog.vue'
import EditSeriesDialog from '@/components/EditSeriesDialog.vue'
import ItemBrowser from '@/components/ItemBrowser.vue'
import ToolbarSticky from '@/components/ToolbarSticky.vue'
import { COLLECTION_CHANGED } from '@/types/events'
import { COLLECTION_CHANGED, SERIES_CHANGED } from '@/types/events'
import Vue from 'vue'
export default Vue.extend({
Expand Down Expand Up @@ -205,9 +205,11 @@ export default Vue.extend({
},
created () {
this.$eventHub.$on(COLLECTION_CHANGED, this.afterDelete)
this.$eventHub.$on(SERIES_CHANGED, this.reloadSeries)
},
beforeDestroy () {
this.$eventHub.$off(COLLECTION_CHANGED, this.afterDelete)
this.$eventHub.$off(SERIES_CHANGED, this.reloadSeries)
},
mounted () {
this.loadCollection(this.collectionId)
Expand Down Expand Up @@ -278,6 +280,9 @@ export default Vue.extend({
afterDelete () {
this.$router.push({ name: 'browse-collections', params: { libraryId: '0' } })
},
reloadSeries (event: EventSeriesChanged) {
if (this.series.some(s => s.id === event.id)) this.loadCollection(this.collectionId)
},
},
})
</script>

0 comments on commit 8f2c453

Please sign in to comment.