[Glitch] Remove hashtags from the last line of a status if it only contains hashtags

Port 061fd66ee6 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2023-08-21 19:39:01 +02:00
committed by Claire
parent 2ce03420d6
commit 18462ee4b6
6 changed files with 428 additions and 58 deletions

View File

@@ -20,8 +20,8 @@ import Bundle from '../features/ui/components/bundle';
import { MediaGallery, Video, Audio } from '../features/ui/util/async-components';
import { displayMedia } from '../initial_state';
import { HashtagBar } from './hashtag_bar';
import AttachmentList from './attachment_list';
import { getHashtagBarForStatus } from './hashtag_bar';
import StatusActionBar from './status_action_bar';
import StatusContent from './status_content';
import StatusHeader from './status_header';
@@ -740,10 +740,6 @@ class Status extends ImmutablePureComponent {
contentMediaIcons.push('tasks');
}
media.push(
<HashtagBar hashtags={status.get('tags')} text={status.get('content')} />
);
// Here we prepare extra data-* attributes for CSS selectors.
// Users can use those for theming, hiding avatars etc via UserStyle
const selectorAttribs = {
@@ -784,6 +780,9 @@ class Status extends ImmutablePureComponent {
muted,
}, 'focusable');
const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status);
media.push(hashtagBar);
return (
<HotKeys handlers={handlers}>
<div
@@ -833,6 +832,7 @@ class Status extends ImmutablePureComponent {
disabled={!history}
tagLinks={settings.get('tag_misleading_links')}
rewriteMentions={settings.get('rewrite_mentions')}
{...statusContentProps}
/>
{!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? (