Prepared for Garden

This commit is contained in:
Dunemask 2021-11-06 20:11:52 -06:00
parent 96ebe71cb6
commit 4bfe7bebc2
9 changed files with 45 additions and 67 deletions

View file

@ -101,7 +101,9 @@ export default class StashContextMenu extends React.Component {
const selectedBoxes = this.props.getSelectedBoxes();
if (selectedBoxes.length !== 1)
return toast.error("Only one file can be selected!");
const url = `${window.location.origin}${process.env.PUBLIC_URL}${downloadUrl}?target=${selectedBoxes[0]}`;
if (window.location.protocol !== "https:")
return toast.error("Cannot clipboard without https!");
const url = `${window.location.origin}/${downloadUrl}?target=${selectedBoxes[0]}`;
navigator.clipboard.writeText(url);
toast.success("Link successfully copied!");
}