Rename for clarity
This commit is contained in:
@@ -55,7 +55,7 @@ function DialogInner({profile}: {profile: bsky.profile.AnyProfileView}) {
|
||||
const tick = useTickEveryMinute()
|
||||
const liveNowConfig = useLiveNowConfig()
|
||||
const {formatted: allowedServices} = getLiveServiceNames(
|
||||
liveNowConfig.allowedDomains,
|
||||
liveNowConfig.currentAccountAllowedHosts,
|
||||
)
|
||||
|
||||
const time = useCallback(
|
||||
|
||||
@@ -31,8 +31,10 @@ export function useLiveLinkMetaQuery(url: string | null) {
|
||||
queryFn: async () => {
|
||||
if (!url) return undefined
|
||||
const urlp = new URL(url)
|
||||
if (!liveNowConfig.allowedDomains.has(urlp.hostname)) {
|
||||
const {formatted} = getLiveServiceNames(liveNowConfig.allowedDomains)
|
||||
if (!liveNowConfig.currentAccountAllowedHosts.has(urlp.hostname)) {
|
||||
const {formatted} = getLiveServiceNames(
|
||||
liveNowConfig.currentAccountAllowedHosts,
|
||||
)
|
||||
throw new Error(
|
||||
_(
|
||||
msg`This service is not supported while the Live feature is in beta. Allowed services: ${formatted}.`,
|
||||
|
||||
@@ -89,7 +89,7 @@ const DEFAULT_LIVE_ALLOWED_DOMAINS = [
|
||||
'www.bluecast.app',
|
||||
]
|
||||
export type LiveNowConfig = {
|
||||
allowedDomains: Set<string>
|
||||
currentAccountAllowedHosts: Set<string>
|
||||
defaultAllowedHosts: Set<string>
|
||||
allowedHostsExceptionsByDid: Map<string, Set<string>>
|
||||
}
|
||||
@@ -107,13 +107,13 @@ export function useLiveNowConfig(): LiveNowConfig {
|
||||
}
|
||||
if (!currentAccount?.did || !canGoLive)
|
||||
return {
|
||||
allowedDomains: new Set(),
|
||||
currentAccountAllowedHosts: new Set(),
|
||||
defaultAllowedHosts,
|
||||
allowedHostsExceptionsByDid,
|
||||
}
|
||||
const vip = ctx.find(live => live.did === currentAccount.did)
|
||||
return {
|
||||
allowedDomains: new Set(
|
||||
currentAccountAllowedHosts: new Set(
|
||||
DEFAULT_LIVE_ALLOWED_DOMAINS.concat(vip ? vip.domains : []),
|
||||
),
|
||||
defaultAllowedHosts,
|
||||
|
||||
Reference in New Issue
Block a user