diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 15:09:50 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 15:09:50 -0600 |
commit | 3725a2eed10707194bc9554a9c58166e9324dfc8 (patch) | |
tree | f167b4541f86eb5b9ff8629c0bbb6486644f498b /src/view/lib/strings.ts | |
parent | 9a6df95adecaf3935fdbd58d893fca6489a040b9 (diff) | |
download | voidsky-3725a2eed10707194bc9554a9c58166e9324dfc8.tar.zst |
Add a server instance selector and drop env vars
Diffstat (limited to 'src/view/lib/strings.ts')
-rw-r--r-- | src/view/lib/strings.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/view/lib/strings.ts b/src/view/lib/strings.ts index 214bb51d6..05b23331f 100644 --- a/src/view/lib/strings.ts +++ b/src/view/lib/strings.ts @@ -1,5 +1,6 @@ import {AtUri} from '../../third-party/uri' import {Entity} from '../../third-party/api/src/client/types/app/bsky/feed/post' +import {PROD_SERVICE} from '../../state' export const MAX_DISPLAY_NAME = 64 export const MAX_DESCRIPTION = 256 @@ -106,3 +107,15 @@ export function cleanError(str: string): string { } return str } + +export function toNiceDomain(url: string): string { + try { + const urlp = new URL(url) + if (`https://${urlp.host}` === PROD_SERVICE) { + return 'Bluesky.Social' + } + return urlp.host + } catch (e) { + return url + } +} |