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