Autocollapse boosts option

This commit is contained in:
kibigo! 2017-11-05 15:05:12 -08:00
parent 0f6d6186b6
commit b0f88fbdc1
4 changed files with 16 additions and 0 deletions

View file

@ -124,6 +124,16 @@ export default class LocalSettingsPage extends React.PureComponent {
> >
<FormattedMessage id='settings.auto_collapse_lengthy' defaultMessage='Lengthy toots' /> <FormattedMessage id='settings.auto_collapse_lengthy' defaultMessage='Lengthy toots' />
</LocalSettingsPageItem> </LocalSettingsPageItem>
<LocalSettingsPageItem
settings={settings}
item={['collapsed', 'auto', 'reblogs']}
id='mastodon-settings--collapsed-auto-reblogs'
onChange={onChange}
dependsOn={[['collapsed', 'enabled']]}
dependsOnNot={[['collapsed', 'auto', 'all']]}
>
<FormattedMessage id='settings.auto_collapse_reblogs' defaultMessage='Boosts' />
</LocalSettingsPageItem>
<LocalSettingsPageItem <LocalSettingsPageItem
settings={settings} settings={settings}
item={['collapsed', 'auto', 'replies']} item={['collapsed', 'auto', 'replies']}

View file

@ -287,6 +287,7 @@ properly and our intersection observer is good to go.
muted, muted,
id, id,
intersectionObserverWrapper, intersectionObserverWrapper,
prepend,
} = this.props; } = this.props;
const autoCollapseSettings = settings.getIn(['collapsed', 'auto']); const autoCollapseSettings = settings.getIn(['collapsed', 'auto']);
@ -299,6 +300,9 @@ properly and our intersection observer is good to go.
node.clientHeight > ( node.clientHeight > (
status.get('media_attachments').size && !muted ? 650 : 400 status.get('media_attachments').size && !muted ? 650 : 400
) )
) || (
autoCollapseSettings.get('reblogs') &&
prepend === 'reblogged_by'
) || ( ) || (
autoCollapseSettings.get('replies') && autoCollapseSettings.get('replies') &&
status.get('in_reply_to_id', null) !== null status.get('in_reply_to_id', null) !== null

View file

@ -14,6 +14,7 @@
"settings.auto_collapse_lengthy": "Lengthy toots", "settings.auto_collapse_lengthy": "Lengthy toots",
"settings.auto_collapse_media": "Toots with media", "settings.auto_collapse_media": "Toots with media",
"settings.auto_collapse_notifications": "Notifications", "settings.auto_collapse_notifications": "Notifications",
"settings.auto_collapse_reblogs": "Boosts",
"settings.auto_collapse_replies": "Replies", "settings.auto_collapse_replies": "Replies",
"settings.close": "Close", "settings.close": "Close",
"settings.collapsed_statuses": "Collapsed toots", "settings.collapsed_statuses": "Collapsed toots",

View file

@ -59,6 +59,7 @@ const initialState = ImmutableMap({
all : false, all : false,
notifications : true, notifications : true,
lengthy : true, lengthy : true,
reblogs : false,
replies : false, replies : false,
media : false, media : false,
}), }),