Skip to content

Commit

Permalink
fix(webui): simplify unread filter
Browse files Browse the repository at this point in the history
only offer UNREAD option, the other 2 are confusing and not really relevant
  • Loading branch information
gotson committed Jun 9, 2020
1 parent 8ba0714 commit bb60f10
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion komga-webui/src/components/FilterMenuButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div v-for="(f, i) in filtersOptions"
:key="i"
>
<v-subheader>{{ f.name }}</v-subheader>
<v-subheader v-if="f.name">{{ f.name }}</v-subheader>
<v-list-item v-for="v in f.values"
:key="v"
@click.stop="click(i, v)"
Expand Down
16 changes: 8 additions & 8 deletions komga-webui/src/views/BrowseLibraries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default Vue.extend({
] as SortOption[],
sortActive: {} as SortActive,
sortDefault: { key: 'metadata.titleSort', order: 'asc' } as SortActive,
filterOptions: [{ name: 'STATUS', values: SeriesStatus }, { name: 'READ STATUS', values: ReadStatus }],
filterOptions: [{ values: [ReadStatus.UNREAD] }, { name: 'STATUS', values: SeriesStatus }],
filters: [[], []] as any[],
sortUnwatch: null as any,
filterUnwatch: null as any,
Expand Down Expand Up @@ -191,8 +191,8 @@ export default Vue.extend({
// restore from query param
this.sortActive = this.parseQuerySortOrDefault(this.$route.query.sort)
this.filters.splice(0, 1, parseQueryFilter(this.$route.query.status, SeriesStatus))
this.filters.splice(1, 1, parseQueryFilter(this.$route.query.readStatus, ReadStatus))
this.filters.splice(1, 1, parseQueryFilter(this.$route.query.status, SeriesStatus))
this.filters.splice(0, 1, parseQueryFilter(this.$route.query.readStatus, ReadStatus))
if (this.$route.query.page) this.page = Number(this.$route.query.page)
if (this.$route.query.pageSize) this.pageSize = Number(this.$route.query.pageSize)
Expand All @@ -206,8 +206,8 @@ export default Vue.extend({
// reset
this.sortActive = this.parseQuerySortOrDefault(to.query.sort)
this.filters.splice(0, 1, parseQueryFilter(to.query.status, SeriesStatus))
this.filters.splice(1, 1, parseQueryFilter(to.query.readStatus, ReadStatus))
this.filters.splice(1, 1, parseQueryFilter(to.query.status, SeriesStatus))
this.filters.splice(0, 1, parseQueryFilter(to.query.readStatus, ReadStatus))
this.page = 1
this.totalPages = 1
this.totalElements = null
Expand Down Expand Up @@ -284,8 +284,8 @@ export default Vue.extend({
page: `${this.page}`,
pageSize: `${this.pageSize}`,
sort: `${this.sortActive.key},${this.sortActive.order}`,
status: `${this.filters[0]}`,
readStatus: `${this.filters[1]}`,
status: `${this.filters[1]}`,
readStatus: `${this.filters[0]}`,
},
}).catch(_ => {
})
Expand All @@ -304,7 +304,7 @@ export default Vue.extend({
if (libraryId !== 0) {
requestLibraryId = libraryId
}
const seriesPage = await this.$komgaSeries.getSeries(requestLibraryId, pageRequest, undefined, this.filters[0], this.filters[1])
const seriesPage = await this.$komgaSeries.getSeries(requestLibraryId, pageRequest, undefined, this.filters[1], this.filters[0])
this.totalPages = seriesPage.totalPages
this.totalElements = seriesPage.totalElements
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 @@ -206,7 +206,7 @@ export default Vue.extend({
}] as SortOption[],
sortActive: {} as SortActive,
sortDefault: { key: 'metadata.numberSort', order: 'asc' } as SortActive,
filterOptions: [{ name: 'READ STATUS', values: ReadStatus }],
filterOptions: [{ values: [ReadStatus.UNREAD] }],
filters: [[]] as any[],
dialogEdit: false,
sortUnwatch: null as any,
Expand Down

0 comments on commit bb60f10

Please sign in to comment.