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