Skip to content

Commit

Permalink
feat(history): allow empty string key
Browse files Browse the repository at this point in the history
fixes #6338
  • Loading branch information
nolimits4web committed Feb 6, 2023
1 parent c6294ad commit a335b09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/history/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export default function History({ swiper, extendParams, on }) {
if (swiper.params.history.root.length > 0) {
let root = swiper.params.history.root;
if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
value = `${root}/${key}/${value}`;
value = `${root}/${key ? `${key}/` : ''}${value}`;
} else if (!location.pathname.includes(key)) {
value = `${key}/${value}`;
value = `${key ? `${key}/` : ''}${value}`;
}
if (swiper.params.history.keepQuery) {
value += location.search;
Expand Down

0 comments on commit a335b09

Please sign in to comment.