From 34927adb741cc20155e30f2f7329b4a1442be093 Mon Sep 17 00:00:00 2001 From: Z Date: Tue, 13 Jul 2021 17:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E4=B8=8D=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E9=97=AD=E7=A4=BE=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/mastodon/containers/status_container.js | 2 +- app/javascript/mastodon/features/compose/index.js | 2 +- .../mastodon/features/ui/components/navigation_panel.js | 4 +++- app/javascript/mastodon/features/ui/components/tabs_bar.js | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/containers/status_container.js b/app/javascript/mastodon/containers/status_container.js index b2f5a4a60..0b9d3385f 100644 --- a/app/javascript/mastodon/containers/status_container.js +++ b/app/javascript/mastodon/containers/status_container.js @@ -109,7 +109,7 @@ const makeMapStateToProps = () => { sonsIds = getSonsIds(state, { id : status.getIn(['reblog', 'id'], props.id)}); if(status.get('reblog')) { ancestorsIds = getAncestorsIds(state, { id: status.getIn(['reblog', 'in_reply_to_id']) }); - if(ancestorsIds && ancestorsIds.first() == treeRoot.split('/').pop()) { + if(ancestorsIds && treeRoot && ancestorsIds.first() == treeRoot.split('/').pop()) { ancestorsText = getAncestorsText(state, { ids: ancestorsIds.shift() }); } } diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index 255b551d5..c77c7fe00 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -113,7 +113,7 @@ class Compose extends React.PureComponent { {!columns.some(column => column.get('id') === 'HOME') && ( )} - {!columns.some(column => column.get('id') === 'TREE') && ( + {!columns.some(column => column.get('id') === 'TREE') && treeRoot && ( )} {!columns.some(column => column.get('id') === 'NOTIFICATIONS') && ( diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.js b/app/javascript/mastodon/features/ui/components/navigation_panel.js index 1a67eeb83..7e97f3df0 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.js +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.js @@ -11,7 +11,9 @@ import TrendsContainer from 'mastodon/features/getting_started/containers/trends const NavigationPanel = () => (
- + {treeRoot && ( + + )} diff --git a/app/javascript/mastodon/features/ui/components/tabs_bar.js b/app/javascript/mastodon/features/ui/components/tabs_bar.js index bd51436a1..59bb3ffa3 100644 --- a/app/javascript/mastodon/features/ui/components/tabs_bar.js +++ b/app/javascript/mastodon/features/ui/components/tabs_bar.js @@ -12,13 +12,14 @@ import ReactHtmlParser, { processNodes, convertNodeToElement, htmlparser2 } from export const links = [ , - , + treeRoot && ( + ), , , , , , -]; +].filter(q => !!q); export function getIndex (path) { return links.findIndex(link => link.props.to === path);