Skip to content

Commit

Permalink
fix: verify if the path starts with /
Browse files Browse the repository at this point in the history
add a condition to verify if the path already starts with /, so we must not add another one

fixes issue decaporg#5569
  • Loading branch information
DenysLins committed Jul 6, 2021
1 parent f9683fa commit 598fbce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class CopyToClipBoardButton extends React.Component {
handleCopy = () => {
clearTimeout(this.timeout);
const { draft, name } = this.props;
const path = `/${this.props.path}`;
const path = this.props.path.charAt(0) !== '/' ? `/${this.props.path}` : this.props.path;
copyToClipboard(isAbsolutePath(path) || !draft ? path : name);
this.setState({ copied: true });
this.timeout = setTimeout(() => this.mounted && this.setState({ copied: false }), 1500);
Expand Down

0 comments on commit 598fbce

Please sign in to comment.