mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 16:03:03 +01:00
feat(webui): refresh browse collection screen on action menu actions
This commit is contained in:
parent
15f9c8257e
commit
8f2c4534c8
1 changed files with 6 additions and 1 deletions
|
|
@ -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({
|
||||
|
|
@ -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)
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue