Add censor reason if available.

This commit is contained in:
Franco Montenegro 2022-08-30 17:38:10 -03:00 committed by zeppi
parent d33856434e
commit f822232642
3 changed files with 11 additions and 2 deletions

1
flow-typed/Claim.js vendored
View file

@ -167,6 +167,7 @@ declare type ClaimErrorCensor = {
take_over_height: number,
},
name: string,
text: string,
normalized_name: string,
nout: number,
permanent_url: string,

View file

@ -165,7 +165,9 @@ function ShowPage(props: Props) {
title={uri}
subtitle={
<>
{__('Your hub has blocked this content because it subscribes to the following blocking channel:')}{' '}
{(!errorCensor || !errorCensor.text) &&
__('Your hub has blocked this content because it subscribes to the following blocking channel:')}
{errorCensor && errorCensor.text}{' '}
<Button
button="link"
navigate={errorCensor && errorCensor.canonical_url}

View file

@ -87,7 +87,13 @@ export function doResolveUris(
if (uriResolveInfo) {
if (uriResolveInfo.error) {
// $FlowFixMe
resolveInfo[uri] = { ...fallbackResolveInfo, errorCensor: uriResolveInfo.error.censor };
resolveInfo[uri] = {
...fallbackResolveInfo,
errorCensor: {
...uriResolveInfo.error.censor,
text: uriResolveInfo.error.text,
},
};
} else {
if (checkReposts) {
if (uriResolveInfo.reposted_claim) {