mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 15:34:17 +01:00
fix(webui): dashboard would not reload when series read progress changed
This commit is contained in:
parent
a6164dadb7
commit
62d378c717
1 changed files with 11 additions and 1 deletions
|
|
@ -208,6 +208,8 @@ import {
|
|||
BOOK_DELETED,
|
||||
READPROGRESS_CHANGED,
|
||||
READPROGRESS_DELETED,
|
||||
READPROGRESS_SERIES_CHANGED,
|
||||
READPROGRESS_SERIES_DELETED,
|
||||
SERIES_ADDED,
|
||||
SERIES_CHANGED,
|
||||
SERIES_DELETED,
|
||||
|
|
@ -217,7 +219,7 @@ import {SeriesDto} from '@/types/komga-series'
|
|||
import {LIBRARIES_ALL, LIBRARY_ROUTE} from '@/types/library'
|
||||
import {throttle} from 'lodash'
|
||||
import {subMonths} from 'date-fns'
|
||||
import {BookSseDto, ReadProgressSseDto, SeriesSseDto} from '@/types/komga-sse'
|
||||
import {BookSseDto, ReadProgressSeriesSseDto, ReadProgressSseDto, SeriesSseDto} from '@/types/komga-sse'
|
||||
import {LibraryDto} from '@/types/komga-libraries'
|
||||
import {PageLoader} from '@/types/pageLoader'
|
||||
|
||||
|
|
@ -256,6 +258,8 @@ export default Vue.extend({
|
|||
this.$eventHub.$on(BOOK_DELETED, this.bookChanged)
|
||||
this.$eventHub.$on(READPROGRESS_CHANGED, this.readProgressChanged)
|
||||
this.$eventHub.$on(READPROGRESS_DELETED, this.readProgressChanged)
|
||||
this.$eventHub.$on(READPROGRESS_SERIES_CHANGED, this.readProgressSeriesChanged)
|
||||
this.$eventHub.$on(READPROGRESS_SERIES_DELETED, this.readProgressSeriesChanged)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$eventHub.$off(SERIES_ADDED, this.seriesChanged)
|
||||
|
|
@ -266,6 +270,8 @@ export default Vue.extend({
|
|||
this.$eventHub.$off(BOOK_DELETED, this.bookChanged)
|
||||
this.$eventHub.$off(READPROGRESS_CHANGED, this.readProgressChanged)
|
||||
this.$eventHub.$off(READPROGRESS_DELETED, this.readProgressChanged)
|
||||
this.$eventHub.$off(READPROGRESS_SERIES_CHANGED, this.readProgressSeriesChanged)
|
||||
this.$eventHub.$off(READPROGRESS_SERIES_DELETED, this.readProgressSeriesChanged)
|
||||
},
|
||||
mounted() {
|
||||
if (this.individualLibrary) this.$store.commit('setLibraryRoute', {
|
||||
|
|
@ -337,6 +343,10 @@ export default Vue.extend({
|
|||
else if (this.loaderRecentlyReleasedBooks?.items.some(b => b.id === event.bookId)) this.reload()
|
||||
else if (this.loaderRecentlyReadBooks?.items.some(b => b.id === event.bookId)) this.reload()
|
||||
},
|
||||
readProgressSeriesChanged(event: ReadProgressSeriesSseDto) {
|
||||
if (this.loaderUpdatedSeries?.items.some(s => s.id === event.seriesId)) this.reload()
|
||||
else if (this.loaderNewSeries?.items.some(s => s.id === event.seriesId)) this.reload()
|
||||
},
|
||||
reload: throttle(function (this: any) {
|
||||
this.loadAll(this.libraryId, true)
|
||||
}, 5000),
|
||||
|
|
|
|||
Loading…
Reference in a new issue