diff --git a/src/components/views/AllCatalog.jsx b/src/components/views/AllCatalog.jsx index 88819ac8..f495bb91 100755 --- a/src/components/views/AllCatalog.jsx +++ b/src/components/views/AllCatalog.jsx @@ -17,6 +17,7 @@ import VerifiedAuthor from '../VerifiedAuthor'; import ModerationModal from '../modals/ModerationModal'; import OfflineIndicator from '../OfflineIndicator'; import SettingsModal from '../modals/SettingsModal'; +import countLinks from '../../utils/countLinks'; import getCommentMediaInfo from '../../utils/getCommentMediaInfo'; import handleStyleChange from '../../utils/handleStyleChange'; import useError from '../../hooks/useError'; @@ -464,6 +465,7 @@ const AllCatalog = () => { const commentMediaInfo = getCommentMediaInfo(thread); const fallbackImgUrl = "assets/filedeleted-res.gif"; const isModerator = moderatorPermissions[thread.subplebbitAddress]; + const linkCount = countLinks(thread); return (
{setIsHoveringOnThread(thread.cid)}} @@ -522,9 +524,14 @@ const AllCatalog = () => {
-
- R: - {thread.replyCount} +
+ R: {thread.replyCount} + {linkCount > 0 ? ( + <> +  / + L: {linkCount} + + ) : null} { onMouseOver={() => setIsHoveringOnThread('rules')} onMouseLeave={() => setIsHoveringOnThread('')}> -
- R:0 +
+ R: 0 / L: 0
{
) : null} -
- R:0 +
+ R: 0 / L: 0 {subplebbit.suggested?.avatarUrl ? null : (
@@ -892,6 +893,7 @@ const Catalog = () => { {feed.map((thread, index) => { const commentMediaInfo = getCommentMediaInfo(thread); const fallbackImgUrl = "assets/filedeleted-res.gif"; + const linkCount = countLinks(thread); return (
{setIsHoveringOnThread(thread.cid)}} @@ -951,9 +953,14 @@ const Catalog = () => { ) : null} -
- R: - {thread.replyCount} +
+ R: {thread.replyCount} + {linkCount > 0 ? ( + <> +  / + L: {linkCount} + + ) : null} {(commentMediaInfo && ( commentMediaInfo.type === 'image' || commentMediaInfo.type === 'video' || diff --git a/src/components/views/SubscriptionsCatalog.jsx b/src/components/views/SubscriptionsCatalog.jsx index 42312209..ce487d2e 100755 --- a/src/components/views/SubscriptionsCatalog.jsx +++ b/src/components/views/SubscriptionsCatalog.jsx @@ -18,6 +18,7 @@ import VerifiedAuthor from '../VerifiedAuthor'; import ModerationModal from '../modals/ModerationModal'; import OfflineIndicator from '../OfflineIndicator'; import SettingsModal from '../modals/SettingsModal'; +import countLinks from '../../utils/countLinks'; import getCommentMediaInfo from '../../utils/getCommentMediaInfo'; import handleStyleChange from '../../utils/handleStyleChange'; import useError from '../../hooks/useError'; @@ -468,6 +469,7 @@ const SubscriptionsCatalog = () => { const commentMediaInfo = getCommentMediaInfo(thread); const fallbackImgUrl = "assets/filedeleted-res.gif"; const isModerator = moderatorPermissions[thread.subplebbitAddress]; + const linkCount = countLinks(thread); return (
{setIsHoveringOnThread(thread.cid)}} @@ -526,9 +528,14 @@ const SubscriptionsCatalog = () => {
-
- R: - {thread.replyCount} +
+ R: {thread.replyCount} + {linkCount > 0 ? ( + <> +  / + L: {linkCount} + + ) : null} 0) { + for (let reply of comment.replies.pages.topAll.comments) { + + if (reply.link) { + linkCount++; + } + + if (reply.replyCount > 0) { + linkCount += countLinks(reply); + } + } + } + + return linkCount; +} + +export default countLinks; \ No newline at end of file