fix timestamp in share links (#1371)

This commit is contained in:
Felix Schröter 2022-09-02 15:37:14 +02:00 committed by GitHub
parent a6927f9bd9
commit e755581d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,11 +69,12 @@ export default {
},
computed: {
generatedLink() {
var href = this.pipedLink
var baseUrl = this.pipedLink
? window.location.origin + "/watch?v=" + this.videoId
: "https://youtu.be/" + this.videoId;
if (this.withTimeCode && this.timeStamp > 0) href += "?t=" + this.timeStamp;
return href;
var url = new URL(baseUrl);
if (this.withTimeCode && this.timeStamp > 0) url.searchParams.append("t", this.timeStamp);
return url.href;
},
},
};