From cb9f3badc79304b795b843f39fc822542f3ad34c Mon Sep 17 00:00:00 2001 From: Mickael KERJEAN Date: Fri, 15 Mar 2019 18:01:55 +1100 Subject: [PATCH] fix (navigation): navigation was braking when a file had a pound in its name --- client/components/breadcrumb.js | 2 +- client/pages/filespage.js | 5 +++-- client/pages/viewerpage.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/components/breadcrumb.js b/client/components/breadcrumb.js index 893b81f1..28b9c65a 100644 --- a/client/components/breadcrumb.js +++ b/client/components/breadcrumb.js @@ -136,7 +136,7 @@ export class PathElementWrapper extends React.Component { return (
  • - + {this.limitSize(this.props.path.label)} diff --git a/client/pages/filespage.js b/client/pages/filespage.js index 5cd042d4..41302c21 100644 --- a/client/pages/filespage.js +++ b/client/pages/filespage.js @@ -32,7 +32,7 @@ export class FilesPage extends React.Component { this.props.history.push(props.match.url + "/"); } this.state = { - path: props.match.url.replace('/files', '') || '/', + path: props.match.url.replace('/files', '').replace(/%23/g, "#") || '/', sort: settings_get('filespage_sort') || 'type', sort_reverse: true, show_hidden: settings_get('filespage_show_hidden') || CONFIG["display_hidden"], @@ -88,7 +88,7 @@ export class FilesPage extends React.Component { if(/\/$/.test(path) === false){ path = path + "/"; } if(/^\//.test(path) === false){ path = "/"+ path; } return path; - }(nextProps.match.params.path); + }(nextProps.match.params.path.replace(/%23/g, "#")); if(new_path !== this.state.path){ this.setState({path: new_path, loading: true}); this.onRefresh(new_path); @@ -117,6 +117,7 @@ export class FilesPage extends React.Component { let files = new Array(res.results.length); for(let i=0,l=res.results.length; i { this.componentDidMount(); }); }