Memoize
This commit is contained in:
@@ -97,6 +97,7 @@ export function useLiveNowConfig(): LiveNowConfig {
|
||||
const ctx = useContext(LiveNowContext)
|
||||
const canGoLive = useCanGoLive()
|
||||
const {currentAccount} = useSession()
|
||||
return useMemo(() => {
|
||||
const defaultAllowedHosts = new Set(DEFAULT_LIVE_ALLOWED_DOMAINS)
|
||||
const allowedHostsExceptionsByDid = new Map<string, Set<string>>()
|
||||
for (const live of ctx) {
|
||||
@@ -119,6 +120,7 @@ export function useLiveNowConfig(): LiveNowConfig {
|
||||
defaultAllowedHosts,
|
||||
allowedHostsExceptionsByDid,
|
||||
}
|
||||
}, [ctx, currentAccount, canGoLive])
|
||||
}
|
||||
|
||||
export function useCanGoLive() {
|
||||
|
||||
Reference in New Issue
Block a user