diff --git a/ui/component/channelThumbnail/view.jsx b/ui/component/channelThumbnail/view.jsx
index 648294d8d..3bdad9ec9 100644
--- a/ui/component/channelThumbnail/view.jsx
+++ b/ui/component/channelThumbnail/view.jsx
@@ -10,25 +10,29 @@ type Props = {
className?: string,
thumbnailPreview: ?string,
obscure?: boolean,
+ small?: boolean,
};
function ChannelThumbnail(props: Props) {
- const { thumbnail, uri, className, thumbnailPreview, obscure } = props;
- // Generate a random color class based on the first letter of the channel name
- let initializer;
- if (thumbnail) {
- const { channelName } = parseURI(uri);
- initializer = channelName.charCodeAt(0) - 65; // will be between 0 and 57
- } else {
- // if we want to default a thumbnail
- initializer = Math.floor(Math.random() * 104729); // 10000th prime number
- }
- const colorClassName = `channel-thumbnail__default--${initializer % 4}`;
+ const { thumbnail, uri, className, thumbnailPreview, obscure, small = false } = props;
const showThumb = !obscure && !!thumbnail;
+
+ // Generate a random color class based on the first letter of the channel name
+ const { channelName } = parseURI(uri);
+
+ let initializer;
+ let colorClassName;
+ if (channelName) {
+ initializer = channelName.charCodeAt(0) - 65; // will be between 0 and 57
+ colorClassName = `channel-thumbnail__default--${Math.abs(initializer % 4)}`;
+ } else {
+ colorClassName = `channel-thumbnail__default--4`;
+ }
return (
{!showThumb && }
diff --git a/ui/component/comment/view.jsx b/ui/component/comment/view.jsx
index d81498b9c..22e0ae2f3 100644
--- a/ui/component/comment/view.jsx
+++ b/ui/component/comment/view.jsx
@@ -36,36 +36,47 @@ function Comment(props: Props) {
// to debounce subsequent requests
const shouldFetch =
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
+
useEffect(() => {
// If author was extracted from the URI, then it must be valid.
if (authorUri && author && !isResolvingUri && shouldFetch) {
resolveUri(authorUri);
}
}, [isResolvingUri, shouldFetch, author, authorUri, resolveUri]);
+
return (