Add autoloadTimelines user setting to configure timeline loading behavior

This commit is contained in:
Alex Gleason 2021-10-15 15:41:40 -05:00
parent 27a30078a3
commit 04787678a2
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 17 additions and 1 deletions

View file

@ -31,6 +31,7 @@ export const defaultSettings = ImmutableMap({
showExplanationBox: true,
explanationBox: true,
otpEnabled: false,
autoloadTimelines: true,
systemFont: false,
dyslexicFont: false,

View file

@ -1,11 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import { throttle } from 'lodash';
import classNames from 'classnames';
import Icon from 'soapbox/components/icon';
import { getSettings } from 'soapbox/actions/settings';
export default @injectIntl
const mapStateToProps = state => {
const settings = getSettings(state);
return {
autoload: settings.get('autoloadTimelines'),
};
};
export default @connect(mapStateToProps)
@injectIntl
class TimelineQueueButtonHeader extends React.PureComponent {
static propTypes = {

View file

@ -230,6 +230,10 @@ class Preferences extends ImmutablePureComponent {
label={<FormattedMessage id='preferences.fields.reduce_motion_label' defaultMessage='Reduce motion in animations' />}
path={['reduceMotion']}
/>
<SettingsCheckbox
label={<FormattedMessage id='preferences.fields.autoload_timelines_label' defaultMessage='Automatically load new posts when scrolled to the top of the page' />}
path={['autoloadTimelines']}
/>
<SettingsCheckbox
label={<FormattedMessage id='preferences.fields.underline_links_label' defaultMessage='Always underline links in posts' />}
path={['underlineLinks']}