From 22d9495b8dca4b22fdf7fb337e79159c956706cf Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 2 Jul 2021 12:38:19 -0400 Subject: [PATCH] fix rss, add icon --- ui/component/claimMenuList/view.jsx | 4 ++-- ui/component/common/icon-custom.jsx | 17 +++++++++++++++++ ui/constants/icons.js | 1 + web/src/rss.js | 8 ++++---- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index c943eee6c..9463d8675 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -358,10 +358,10 @@ function ClaimMenuList(props: Props) {
- {isChannelPage && ( + {isChannelPage && IS_WEB && (
- + {__('Copy RSS URL')}
diff --git a/ui/component/common/icon-custom.jsx b/ui/component/common/icon-custom.jsx index 08179ec10..5cce89e81 100644 --- a/ui/component/common/icon-custom.jsx +++ b/ui/component/common/icon-custom.jsx @@ -2299,4 +2299,21 @@ export const icons = { ), + [ICONS.RSS]: (props: CustomProps) => ( + + + + + + ), }; diff --git a/ui/constants/icons.js b/ui/constants/icons.js index d61223110..10221a2af 100644 --- a/ui/constants/icons.js +++ b/ui/constants/icons.js @@ -161,3 +161,4 @@ export const LIVESTREAM_MONOCHROME = 'LivestreamMono'; export const STACK = 'stack'; export const TIME = 'time'; export const GLOBE = 'globe'; +export const RSS = 'rss'; diff --git a/web/src/rss.js b/web/src/rss.js index 0c25e0c13..241521c3b 100644 --- a/web/src/rss.js +++ b/web/src/rss.js @@ -46,11 +46,11 @@ async function getFeed(channelClaim) { const options = { title: title + ' on ' + SITE_NAME, - description: value ? replaceLineFeeds(value.description) : '', + description: value && value.description ? replaceLineFeeds(value.description) : '', link: `${URL}/${channelClaim.name}:${channelClaim.claim_id}`, favicon: URL + '/public/favicon.png', generator: SITE_NAME + ' RSS Feed', - image: value ? value.thumbnail.url : '', + image: value && value.thumbnail ? value.thumbnail.url : '', author: { name: channelClaim.name, link: URL + '/' + channelClaim.name + ':' + channelClaim.claim_id, @@ -69,8 +69,8 @@ async function getFeed(channelClaim) { guid: c.claim_id, id: c.claim_id, title: value ? value.title : c.name, - description: value ? replaceLineFeeds(value.description) : '', - image: value ? value.thumbnail.url : '', + description: value && value.description ? replaceLineFeeds(value.description) : '', + image: value && value.thumbnail ? value.thumbnail.url : '', link: URL + '/' + c.name + ':' + c.claim_id, date: new Date(meta ? meta.creation_timestamp * 1000 : null), });