change display of blocked error

This commit is contained in:
zeppi 2022-11-04 16:35:04 -04:00
parent 6d52763e19
commit 1d55a84c94
4 changed files with 27 additions and 13 deletions

View file

@ -2319,5 +2319,7 @@
"Your hub has blocked this content because it subscribes to the following blocking channel:": "Your hub has blocked this content because it subscribes to the following blocking channel:",
"Your hub has blocked access to this content do to a complaint received under the US Digital Millennium Copyright Act.": "Your hub has blocked access to this content do to a complaint received under the US Digital Millennium Copyright Act.",
"Autoplay Next is on.": "Autoplay Next is on.",
"Content Blocked": "Content Blocked",
"Your hub has blocked %content% because it subscribes to the following blocking channel:": "Your hub has blocked %content% because it subscribes to the following blocking channel:",
"--end--": "--end--"
}

View file

@ -162,17 +162,19 @@ function ShowPage(props: Props) {
) : (
<Page>
<Card
title={uri}
title={__('Content Blocked')}
subtitle={
<>
{(!errorCensor || !errorCensor.text) &&
__('Your hub has blocked this content because it subscribes to the following blocking channel:')}
{errorCensor && errorCensor.text}{' '}
{errorCensor &&
__(`Your hub has blocked %content% because it subscribes to the following blocking channel:`, {
content: uri,
})}{' '}
<Button
button="link"
navigate={errorCensor && errorCensor.canonical_url}
label={errorCensor && errorCensor.name}
/>
{errorCensor && <div className={'error__text'}>{`\nMessage:\n${errorCensor.text}\n`}</div>}
</>
}
/>

View file

@ -86,16 +86,25 @@ export function doResolveUris(
// https://github.com/facebook/flow/issues/2221
if (uriResolveInfo) {
if (uriResolveInfo.error) {
// $FlowFixMe
resolveInfo[uri] = {
...fallbackResolveInfo,
errorCensor: {
// TODO: handled filtered too
if (uriResolveInfo.error.name === 'BLOCKED') {
// $FlowFixMe
resolveInfo[uri] = {
// $FlowFixMe
...uriResolveInfo.error.censor,
// $FlowFixMe
text: uriResolveInfo.error.text,
},
};
...fallbackResolveInfo,
errorCensor: {
// $FlowFixMe
...uriResolveInfo.error.censor,
// $FlowFixMe
text: uriResolveInfo.error.text,
}, // $FlowFixMe
};
} else {
// $FlowFixMe
resolveInfo[uri] = {
...fallbackResolveInfo,
};
}
} else {
if (checkReposts) {
if (uriResolveInfo.reposted_claim) {

View file

@ -83,6 +83,7 @@ export const selectClaimIdForUri = (state: State, uri: string) => selectClaimIds
export const selectReflectingById = (state: State) => selectState(state).reflectingById;
// TODO: remove this.
export const makeSelectBlacklistedDueToDMCA = (claimUri: string) =>
createSelector(makeSelectClaimErrorCensor(claimUri), (claimError) => {
if (!claimError) {