Properly handle searchParams
This should avoid the pitfalls of trying to manually decide to attach inline=true with a ? or a &.
This commit is contained in:
parent
73932a666d
commit
70991aebaa
@ -93,7 +93,7 @@
|
||||
</a>
|
||||
<a
|
||||
target="_blank"
|
||||
:href="link + '&inline=true'"
|
||||
:href="inlineLink"
|
||||
class="button button--flat"
|
||||
v-if="!req.isDir"
|
||||
>
|
||||
@ -239,6 +239,10 @@ export default {
|
||||
const path = this.$route.path.split("/").splice(2).join("/");
|
||||
return `${baseURL}/api/public/dl/${path}${queryArg}`;
|
||||
},
|
||||
inlineLink: function () {
|
||||
url = new URL(this.link);
|
||||
url.searchParams.set('inline', 'true');
|
||||
return url.href;
|
||||
fullLink: function () {
|
||||
return window.location.origin + this.link;
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user