Skip to content

Commit

Permalink
fix(webui): filter values could be duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Sep 1, 2020
1 parent e0cff70 commit e91954f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions komga-webui/src/views/BrowseCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ export default Vue.extend({
this.collection = await this.$komgaCollections.getOneCollection(collectionId)
await this.loadSeries(collectionId)
this.filterOptionsPanel.library.values.push(...this.$store.state.komgaLibraries.libraries.map((x: LibraryDto) => ({
this.filterOptionsPanel.library.values = this.$store.state.komgaLibraries.libraries.map((x: LibraryDto) => ({
name: x.name,
value: x.id,
})))
this.filterOptionsPanel.genre.values.push(...toNameValue(await this.$komgaReferential.getGenres(undefined, collectionId)))
this.filterOptionsPanel.tag.values.push(...toNameValue(await this.$komgaReferential.getTags(undefined, undefined, collectionId)))
this.filterOptionsPanel.publisher.values.push(...toNameValue(await this.$komgaReferential.getPublishers(undefined, collectionId)))
this.filterOptionsPanel.language.values.push(...(await this.$komgaReferential.getLanguages(undefined, collectionId)))
this.filterOptionsPanel.ageRating.values.push(...toNameValue(await this.$komgaReferential.getAgeRatings(undefined, collectionId)))
}))
this.filterOptionsPanel.genre.values = toNameValue(await this.$komgaReferential.getGenres(undefined, collectionId))
this.filterOptionsPanel.tag.values = toNameValue(await this.$komgaReferential.getTags(undefined, undefined, collectionId))
this.filterOptionsPanel.publisher.values = toNameValue(await this.$komgaReferential.getPublishers(undefined, collectionId))
this.filterOptionsPanel.language.values = (await this.$komgaReferential.getLanguages(undefined, collectionId))
this.filterOptionsPanel.ageRating.values = toNameValue(await this.$komgaReferential.getAgeRatings(undefined, collectionId))
},
updateRoute () {
const loc = {
Expand Down
10 changes: 5 additions & 5 deletions komga-webui/src/views/BrowseLibraries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ export default Vue.extend({
this.library = this.getLibraryLazy(libraryId)
const requestLibraryId = libraryId !== LIBRARIES_ALL ? libraryId : undefined
this.filterOptionsPanel.genre.values.push(...toNameValue(await this.$komgaReferential.getGenres(requestLibraryId)))
this.filterOptionsPanel.tag.values.push(...toNameValue(await this.$komgaReferential.getTags(requestLibraryId)))
this.filterOptionsPanel.publisher.values.push(...toNameValue(await this.$komgaReferential.getPublishers(requestLibraryId)))
this.filterOptionsPanel.language.values.push(...(await this.$komgaReferential.getLanguages(requestLibraryId)))
this.filterOptionsPanel.ageRating.values.push(...toNameValue(await this.$komgaReferential.getAgeRatings(requestLibraryId)))
this.filterOptionsPanel.genre.values = toNameValue(await this.$komgaReferential.getGenres(requestLibraryId))
this.filterOptionsPanel.tag.values = toNameValue(await this.$komgaReferential.getTags(requestLibraryId))
this.filterOptionsPanel.publisher.values = toNameValue(await this.$komgaReferential.getPublishers(requestLibraryId))
this.filterOptionsPanel.language.values = (await this.$komgaReferential.getLanguages(requestLibraryId))
this.filterOptionsPanel.ageRating.values = toNameValue(await this.$komgaReferential.getAgeRatings(requestLibraryId))
await this.loadPage(libraryId, this.page, this.sortActive)
},
Expand Down
2 changes: 1 addition & 1 deletion komga-webui/src/views/BrowseSeries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export default Vue.extend({
this.series = await this.$komgaSeries.getOneSeries(seriesId)
this.collections = await this.$komgaSeries.getCollections(seriesId)
this.filterOptionsPanel.tag.values.push(...toNameValue(await this.$komgaReferential.getTags(undefined, this.seriesId)))
this.filterOptionsPanel.tag.values = toNameValue(await this.$komgaReferential.getTags(undefined, this.seriesId))
await this.loadPage(seriesId, this.page, this.sortActive)
},
Expand Down

0 comments on commit e91954f

Please sign in to comment.