diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-21 16:07:26 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-21 16:07:26 -0600 |
commit | ed146a582c140b9a472298390dafbc07bd06cf60 (patch) | |
tree | bd540e4a84244fdbdbdf5fde412fc4a179b6dae5 /src/view/lib/strings.ts | |
parent | 39058cd36a9839df0e0c7e30ba486a09e30f169c (diff) | |
download | voidsky-ed146a582c140b9a472298390dafbc07bd06cf60.tar.zst |
Add web linking and proper share controls
Diffstat (limited to 'src/view/lib/strings.ts')
-rw-r--r-- | src/view/lib/strings.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/view/lib/strings.ts b/src/view/lib/strings.ts index b12fbd398..84ee07f37 100644 --- a/src/view/lib/strings.ts +++ b/src/view/lib/strings.ts @@ -140,3 +140,12 @@ export function toNiceDomain(url: string): string { return url } } + +export function toShareUrl(url: string) { + if (!url.startsWith('https')) { + const urlp = new URL('https://bsky.app') + urlp.pathname = url + url = urlp.toString() + } + return url +} |