diff --git a/admin_ui/src/views/RowListing.vue b/admin_ui/src/views/RowListing.vue index 9946e8b9..bdc1bb83 100644 --- a/admin_ui/src/views/RowListing.vue +++ b/admin_ui/src/views/RowListing.vue @@ -474,6 +474,9 @@ export default Vue.extend({ return Object.fromEntries(orderBy.map((i) => [i.column, i])) }, + filterParams(): { [key: string]: any } { + return this.$store.state.filterParams + }, rowCount() { return this.$store.state.rowCount }, @@ -650,11 +653,31 @@ export default Vue.extend({ await this.fetchRows() }, "$route.query": async function () { - this.$store.commit( - "updateFilterParams", - this.$router.currentRoute.query - ) - await this.fetchRows() + const queryParams = this.$router.currentRoute.query + const orderBy = queryParams.__order + + if (orderBy) { + delete queryParams.__order + } + + const paramsChanged = + JSON.stringify(this.filterParams) != + JSON.stringify(this.filterParams) + + if (paramsChanged) { + this.$store.commit("updateFilterParams", queryParams) + } + + if (orderBy) { + this.$store.commit( + "updateOrderBy", + deserialiseOrderByString(orderBy) + ) + } + + if (paramsChanged || orderBy) { + await this.fetchRows() + } }, rows() { this.resetRowCheckbox()