Fix extraneous copy to clipboard at startup

This commit is contained in:
Jeremy Ruston
2024-05-29 15:06:15 +01:00
parent d5dec1169a
commit 15edb586ba

View File

@@ -220,7 +220,9 @@ function updateLocationHash(options) {
url = $tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList));
break;
}
$tw.utils.copyToClipboard(url,{successNotification: options.successNotification, failureNotification: options.failureNotification});
if(url) {
$tw.utils.copyToClipboard(url,{successNotification: options.successNotification, failureNotification: options.failureNotification});
}
// Only change the location hash if we must, thus avoiding unnecessary onhashchange events
if($tw.utils.getLocationHash() !== $tw.locationHash) {
if(options.updateHistory === "yes") {