Geoblock: support content claim id as well (#1096)

This commit is contained in:
infinite-persistence 2022-03-15 11:48:26 -07:00 committed by GitHub
parent 58c9209c96
commit 5445a95c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -837,18 +837,20 @@ export const selectGeoRestrictionForUri = createCachedSelector(
selectGeoBlockLists,
(claim, geoBlockLists) => {
const locale: LocaleInfo = window[SETTINGS.LOCALE]; // <-- NOTE: not handled by redux updates
if (locale && geoBlockLists && claim) {
const claimId: ?string = claim.claim_id;
const channelId: ?string = getChannelIdFromClaim(claim);
if (locale && geoBlockLists && channelId && claim) {
let geoConfig: ?GeoConfig;
// --- livestreams
if (isStreamPlaceholderClaim(claim)) {
geoConfig = geoBlockLists.livestreams && geoBlockLists.livestreams[channelId];
if (isStreamPlaceholderClaim(claim) && geoBlockLists.livestreams) {
geoConfig = geoBlockLists.livestreams[channelId] || geoBlockLists.livestreams[claimId];
}
// --- videos (a.k.a everything else)
else {
geoConfig = geoBlockLists.videos && geoBlockLists.videos[channelId];
else if (geoBlockLists.videos) {
geoConfig = geoBlockLists.videos[channelId] || geoBlockLists.videos[claimId];
}
if (geoConfig) {