Fix Live Now not showing for non-streamer (#9773)

* Fix Live Now not showing for non-streamer

* Rename for clarity

* Logged out users too
This commit is contained in:
Eric Bailey
2026-01-27 12:16:54 -06:00
committed by GitHub
parent 2953b3a094
commit fd6b8fcbf1
3 changed files with 20 additions and 6 deletions
+11 -1
View File
@@ -90,17 +90,27 @@ const DEFAULT_LIVE_ALLOWED_DOMAINS = [
]
export type LiveNowConfig = {
allowedDomains: Set<string>
allSupportedDomains: Set<string>
}
export function useLiveNowConfig(): LiveNowConfig {
const ctx = useContext(LiveNowContext)
const canGoLive = useCanGoLive()
const {currentAccount} = useSession()
if (!currentAccount?.did || !canGoLive) return {allowedDomains: new Set()}
const allVipDomains = new Set(ctx.flatMap(live => live.domains))
const allSupportedDomains = new Set(
DEFAULT_LIVE_ALLOWED_DOMAINS.concat(Array.from(allVipDomains)),
)
if (!currentAccount?.did || !canGoLive)
return {
allowedDomains: new Set(),
allSupportedDomains,
}
const vip = ctx.find(live => live.did === currentAccount.did)
return {
allowedDomains: new Set(
DEFAULT_LIVE_ALLOWED_DOMAINS.concat(vip ? vip.domains : []),
),
allSupportedDomains,
}
}