Add a server instance selector and drop env vars

This commit is contained in:
Paul Frazee 2022-11-15 15:09:50 -06:00
parent 9a6df95ade
commit 3725a2eed1
14 changed files with 383 additions and 174 deletions

View file

@ -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
}
}