This commit is contained in:
Mickael Kerjean 2019-05-01 02:14:23 +10:00
commit f8cc366165
2 changed files with 4 additions and 2 deletions

View file

@ -38,7 +38,7 @@ function encode_path(path){
}
export function prepare(path){
return encodeURIComponent(decodeURIComponent(path)); // to send our url correctly without using directly '/'
return encodeURIComponent(decodeURIComponent(path.replace(/%/g, '%25')));
}
export function urlParams() {

View file

@ -240,9 +240,11 @@ export class ExistingThing extends React.Component {
}
className = className.trim();
let encodedLink = encodeURIComponent(this.props.file.link).replace(/%2F/g, '/');
return connectDragSource(connectDropNativeFile(connectDropFile(
<div className={"component_thing view-"+this.props.view+(this.props.selected === true ? " selected" : " not-selected")}>
<ToggleableLink onClick={this.onThingClick.bind(this)} to={this.props.file.link + window.location.search} disabled={this.props.file.icon === "loading"}>
<ToggleableLink onClick={this.onThingClick.bind(this)} to={encodedLink + window.location.search} disabled={this.props.file.icon === "loading"}>
<Card ref="$card"className={this.state.hover} className={className}>
<Image preview={this.state.preview}
icon={this.props.file.icon || this.props.file.type}