diff --git a/changes/changelog.d/902.bugfix b/changes/changelog.d/902.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..afe2ade816ef700e28f09b64bd3ffd7179a0532f --- /dev/null +++ b/changes/changelog.d/902.bugfix @@ -0,0 +1 @@ +Fixed search usability issue when browsing artists, albums, radios and playlists (#902) diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index ed97f7a4e0127063fc7f28e272de707c63d160d1..0e0fa465087693f0321bd6401236409aa29d9ca3 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -110,7 +110,7 @@ export default { result: null, page: parseInt(this.defaultPage), query: this.defaultQuery, - tags: this.defaultTags.filter((t) => { return t.length > 0 }) || [], + tags: (this.defaultTags || []).filter((t) => { return t.length > 0 }), paginateBy: parseInt(this.defaultPaginateBy || 25), orderingDirection: defaultOrdering.direction || "+", ordering: defaultOrdering.field, @@ -135,15 +135,18 @@ export default { }, methods: { updateQueryString: _.debounce(function() { - this.$router.replace({ - query: { + history.pushState( + {}, + null, + this.$route.path + '?' + new URLSearchParams( + { query: this.query, page: this.page, tag: this.tags, paginateBy: this.paginateBy, ordering: this.getOrderingAsString() - } - }) + }).toString() + ) }, 500), fetchData: _.debounce(function() { var self = this diff --git a/front/src/components/library/Artists.vue b/front/src/components/library/Artists.vue index c1a13aed9975207d6271a272f57c27ce1688fa54..2ac23ac8e7df59906629ccd6aaa5d922639838e7 100644 --- a/front/src/components/library/Artists.vue +++ b/front/src/components/library/Artists.vue @@ -98,7 +98,7 @@ export default { result: null, page: parseInt(this.defaultPage), query: this.defaultQuery, - tags: this.defaultTags.filter((t) => { return t.length > 0 }) || [], + tags: (this.defaultTags || []).filter((t) => { return t.length > 0 }), paginateBy: parseInt(this.defaultPaginateBy || 30), orderingDirection: defaultOrdering.direction || "+", ordering: defaultOrdering.field, @@ -123,15 +123,18 @@ export default { }, methods: { updateQueryString: _.debounce(function() { - this.$router.replace({ - query: { + history.pushState( + {}, + null, + this.$route.path + '?' + new URLSearchParams( + { query: this.query, page: this.page, tag: this.tags, paginateBy: this.paginateBy, ordering: this.getOrderingAsString() - } - }) + }).toString() + ) }, 500), fetchData: _.debounce(function() { var self = this diff --git a/front/src/components/library/Radios.vue b/front/src/components/library/Radios.vue index 9f59db514ccb2bab0b0d9860d1cee72eb6facab5..2d68d9072381cbb375eca65f992e8bb8b2f2f574 100644 --- a/front/src/components/library/Radios.vue +++ b/front/src/components/library/Radios.vue @@ -154,14 +154,17 @@ export default { }, methods: { updateQueryString: _.debounce(function() { - this.$router.replace({ - query: { + history.pushState( + {}, + null, + this.$route.path + '?' + new URLSearchParams( + { query: this.query, page: this.page, paginateBy: this.paginateBy, ordering: this.getOrderingAsString() - } - }) + }).toString() + ) }, 500), fetchData: _.debounce(function() { var self = this diff --git a/front/src/views/playlists/List.vue b/front/src/views/playlists/List.vue index 160b7b83c3785ee44bb3b449c97ef99bc54a756b..1ff56b5d5492b8692d5ce63be73447fb1312a148 100644 --- a/front/src/views/playlists/List.vue +++ b/front/src/views/playlists/List.vue @@ -113,14 +113,17 @@ export default { }, methods: { updateQueryString: _.debounce(function() { - this.$router.replace({ - query: { + history.pushState( + {}, + null, + this.$route.path + '?' + new URLSearchParams( + { query: this.query, page: this.page, paginateBy: this.paginateBy, ordering: this.getOrderingAsString() - } - }) + }).toString() + ) }, 250), fetchData: _.debounce(function() { var self = this