Skip to content

Commit e937f1b

Browse files
committed
shareUrl: use URL interface instead of string manipulations
1 parent 5b387a0 commit e937f1b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

apps/client/src/widgets/shared_info.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export default function SharedInfo() {
2424
const shareId = getShareId(note);
2525

2626
if (syncServerHost) {
27-
const cleanedServerHost = syncServerHost.replace(/\/$/, "");
28-
link = `${cleanedServerHost}/share/${shareId}`;
27+
link = new URL(`/share/${shareId}`, syncServerHost).href;
2928
} else {
3029
let host = location.host;
3130
if (host.endsWith("/")) {

0 commit comments

Comments
 (0)