Skip to content

Commit

Permalink
decode uri path before manipulating
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed May 2, 2022
1 parent 0c6edce commit 6998b93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/js/ReaderApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ class ReaderApp extends Component {
window.open(url, '_blank')
return true;
}
const path = url.pathname;
const path = decodeURI(url.pathname);
const params = url.searchParams;
const openPanel = replace ? this.openPanel : this.openPanelAtEnd;
if (path === "/") {
Expand All @@ -1025,7 +1025,7 @@ class ReaderApp extends Component {
this.showSaved();

} else if (path.match(/\/texts\/.+/)) {
this.showLibrary(path.slice(7).split("/").map(decodeURI));
this.showLibrary(path.slice(7).split("/"));

} else if (path === "/collections") {
this.showCollections();
Expand Down

0 comments on commit 6998b93

Please sign in to comment.