Skip to content

Commit

Permalink
[ICIJ/datashare#368] Fix the last issue on hard refresh on BatchSearc…
Browse files Browse the repository at this point in the history
…hResults page
  • Loading branch information
annelhote committed Mar 13, 2020
1 parent dc1aa97 commit 34cc363
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/BatchSearchResultsFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ import filter from 'lodash/filter'
import find from 'lodash/find'
import get from 'lodash/get'
import indexOf from 'lodash/indexOf'
import isEqual from 'lodash/isEqual'
import map from 'lodash/map'
import omit from 'lodash/omit'
import orderBy from 'lodash/orderBy'
export default {
Expand Down Expand Up @@ -140,7 +142,11 @@ export default {
const queriesSort = get(this, ['$route', 'query', 'queries_sort'], undefined)
const sort = get(this, ['$route', 'query', 'sort'], undefined)
this.$set(this, 'selectedQueriesOnRouteEnter', [])
this.$router.push({ name: 'batch-search.results', query: { order, page, queries, queries_sort: queriesSort, sort } }).catch(() => {})
const query = { order, page, queries, queries_sort: queriesSort, sort }
const isEqualQuery = isEqual(omit(query, 'queries'), omit(this.$route.query, 'queries')) && isEqual(castArray(query.queries), castArray(this.$route.query.queries))
if (!isEqualQuery) {
this.$router.push({ name: 'batch-search.results', query }).catch(() => {})
}
},
executeSearch (query) {
this.$store.commit('search/reset')
Expand Down

0 comments on commit 34cc363

Please sign in to comment.