Merge branch 'feed-settings' into 'develop'
Make all timelines use "home" timeline settings Closes #1230 See merge request soapbox-pub/soapbox!2030
This commit is contained in:
commit
472af420c0
4 changed files with 8 additions and 9 deletions
|
@ -45,6 +45,7 @@ const CommunityTimeline = () => {
|
||||||
<Timeline
|
<Timeline
|
||||||
scrollKey={`${timelineId}_timeline`}
|
scrollKey={`${timelineId}_timeline`}
|
||||||
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
||||||
|
prefix='home'
|
||||||
onLoadMore={handleLoadMore}
|
onLoadMore={handleLoadMore}
|
||||||
emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}
|
emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}
|
||||||
divideType='space'
|
divideType='space'
|
||||||
|
|
|
@ -121,17 +121,11 @@ const Preferences = () => {
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form>
|
||||||
<List>
|
<List>
|
||||||
<ListItem
|
<ListItem label={<FormattedMessage id='home.column_settings.show_reblogs' defaultMessage='Show reposts' />}>
|
||||||
label={<FormattedMessage id='home.column_settings.show_reblogs' defaultMessage='Show reposts' />}
|
|
||||||
hint={<FormattedMessage id='preferences.hints.feed' defaultMessage='In your home feed' />}
|
|
||||||
>
|
|
||||||
<SettingToggle settings={settings} settingPath={['home', 'shows', 'reblog']} onChange={onToggleChange} />
|
<SettingToggle settings={settings} settingPath={['home', 'shows', 'reblog']} onChange={onToggleChange} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
<ListItem
|
<ListItem label={<FormattedMessage id='home.column_settings.show_replies' defaultMessage='Show replies' />}>
|
||||||
label={<FormattedMessage id='home.column_settings.show_replies' defaultMessage='Show replies' />}
|
|
||||||
hint={<FormattedMessage id='preferences.hints.feed' defaultMessage='In your home feed' />}
|
|
||||||
>
|
|
||||||
<SettingToggle settings={settings} settingPath={['home', 'shows', 'reply']} onChange={onToggleChange} />
|
<SettingToggle settings={settings} settingPath={['home', 'shows', 'reply']} onChange={onToggleChange} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
|
|
@ -92,6 +92,7 @@ const CommunityTimeline = () => {
|
||||||
<Timeline
|
<Timeline
|
||||||
scrollKey={`${timelineId}_timeline`}
|
scrollKey={`${timelineId}_timeline`}
|
||||||
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
||||||
|
prefix='home'
|
||||||
onLoadMore={handleLoadMore}
|
onLoadMore={handleLoadMore}
|
||||||
emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other servers to fill it up' />}
|
emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other servers to fill it up' />}
|
||||||
divideType='space'
|
divideType='space'
|
||||||
|
|
|
@ -16,19 +16,22 @@ const messages = defineMessages({
|
||||||
interface ITimeline extends Omit<IStatusList, 'statusIds' | 'isLoading' | 'hasMore'> {
|
interface ITimeline extends Omit<IStatusList, 'statusIds' | 'isLoading' | 'hasMore'> {
|
||||||
/** ID of the timeline in Redux. */
|
/** ID of the timeline in Redux. */
|
||||||
timelineId: string,
|
timelineId: string,
|
||||||
|
/** Settings path to use instead of the timelineId. */
|
||||||
|
prefix?: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Scrollable list of statuses from a timeline in the Redux store. */
|
/** Scrollable list of statuses from a timeline in the Redux store. */
|
||||||
const Timeline: React.FC<ITimeline> = ({
|
const Timeline: React.FC<ITimeline> = ({
|
||||||
timelineId,
|
timelineId,
|
||||||
onLoadMore,
|
onLoadMore,
|
||||||
|
prefix,
|
||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const getStatusIds = useCallback(makeGetStatusIds(), []);
|
const getStatusIds = useCallback(makeGetStatusIds(), []);
|
||||||
|
|
||||||
const lastStatusId = useAppSelector(state => (state.timelines.get(timelineId)?.items || ImmutableOrderedSet()).last() as string | undefined);
|
const lastStatusId = useAppSelector(state => (state.timelines.get(timelineId)?.items || ImmutableOrderedSet()).last() as string | undefined);
|
||||||
const statusIds = useAppSelector(state => getStatusIds(state, { type: timelineId }));
|
const statusIds = useAppSelector(state => getStatusIds(state, { type: timelineId, prefix }));
|
||||||
const isLoading = useAppSelector(state => (state.timelines.get(timelineId) || { isLoading: true }).isLoading === true);
|
const isLoading = useAppSelector(state => (state.timelines.get(timelineId) || { isLoading: true }).isLoading === true);
|
||||||
const isPartial = useAppSelector(state => (state.timelines.get(timelineId)?.isPartial || false) === true);
|
const isPartial = useAppSelector(state => (state.timelines.get(timelineId)?.isPartial || false) === true);
|
||||||
const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true);
|
const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true);
|
||||||
|
|
Loading…
Reference in a new issue