mirror of
https://github.com/zadam/trilium.git
synced 2025-11-21 16:14:23 +01:00
shareUrl: use URL interface instead of string manipulations
This commit is contained in:
parent
5b387a0b11
commit
e937f1b601
@ -24,8 +24,7 @@ export default function SharedInfo() {
|
|||||||
const shareId = getShareId(note);
|
const shareId = getShareId(note);
|
||||||
|
|
||||||
if (syncServerHost) {
|
if (syncServerHost) {
|
||||||
const cleanedServerHost = syncServerHost.replace(/\/$/, "");
|
link = new URL(`/share/${shareId}`, syncServerHost).href;
|
||||||
link = `${cleanedServerHost}/share/${shareId}`;
|
|
||||||
} else {
|
} else {
|
||||||
let host = location.host;
|
let host = location.host;
|
||||||
if (host.endsWith("/")) {
|
if (host.endsWith("/")) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user