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