Update IS_PROD check (#2930)

* update is_prod check

* remove unused constants

* rename `IS_PROD` function to `IS_PROD_SERVICE`
This commit is contained in:
Hailey 2024-02-19 13:30:25 -08:00 committed by GitHub
parent 943acd16aa
commit 5573c38c4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 100 deletions

View file

@ -1,5 +1,5 @@
import {AtUri} from '@atproto/api'
import {PROD_SERVICE} from 'lib/constants'
import {BSKY_SERVICE} from 'lib/constants'
import TLDs from 'tlds'
import psl from 'psl'
@ -28,7 +28,7 @@ export function makeRecordUri(
export function toNiceDomain(url: string): string {
try {
const urlp = new URL(url)
if (`https://${urlp.host}` === PROD_SERVICE) {
if (`https://${urlp.host}` === BSKY_SERVICE) {
return 'Bluesky Social'
}
return urlp.host ? urlp.host : url