Geoblock: support content claim id as well (#1096)
This commit is contained in:
parent
58c9209c96
commit
5445a95c9a
1 changed files with 8 additions and 6 deletions
|
@ -837,18 +837,20 @@ export const selectGeoRestrictionForUri = createCachedSelector(
|
||||||
selectGeoBlockLists,
|
selectGeoBlockLists,
|
||||||
(claim, geoBlockLists) => {
|
(claim, geoBlockLists) => {
|
||||||
const locale: LocaleInfo = window[SETTINGS.LOCALE]; // <-- NOTE: not handled by redux updates
|
const locale: LocaleInfo = window[SETTINGS.LOCALE]; // <-- NOTE: not handled by redux updates
|
||||||
const channelId: ?string = getChannelIdFromClaim(claim);
|
|
||||||
|
|
||||||
if (locale && geoBlockLists && channelId && claim) {
|
if (locale && geoBlockLists && claim) {
|
||||||
|
const claimId: ?string = claim.claim_id;
|
||||||
|
const channelId: ?string = getChannelIdFromClaim(claim);
|
||||||
|
|
||||||
let geoConfig: ?GeoConfig;
|
let geoConfig: ?GeoConfig;
|
||||||
|
|
||||||
// --- livestreams
|
// --- livestreams
|
||||||
if (isStreamPlaceholderClaim(claim)) {
|
if (isStreamPlaceholderClaim(claim) && geoBlockLists.livestreams) {
|
||||||
geoConfig = geoBlockLists.livestreams && geoBlockLists.livestreams[channelId];
|
geoConfig = geoBlockLists.livestreams[channelId] || geoBlockLists.livestreams[claimId];
|
||||||
}
|
}
|
||||||
// --- videos (a.k.a everything else)
|
// --- videos (a.k.a everything else)
|
||||||
else {
|
else if (geoBlockLists.videos) {
|
||||||
geoConfig = geoBlockLists.videos && geoBlockLists.videos[channelId];
|
geoConfig = geoBlockLists.videos[channelId] || geoBlockLists.videos[claimId];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geoConfig) {
|
if (geoConfig) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue