From 9f3c3f5209a1e58b187a685ef0da08078d9c6bb2 Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 2 Jul 2023 20:24:27 +0200 Subject: [PATCH] =?UTF-8?q?Show=20local-only=20posts=20in=20=E2=80=9CAll?= =?UTF-8?q?=E2=80=9D=20by=20default,=20and=20add=20back=20option=20to=20to?= =?UTF-8?q?ggle=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flavours/glitch/features/firehose/index.jsx | 16 ++++++++++++---- app/javascript/flavours/glitch/locales/en.json | 1 + .../flavours/glitch/reducers/settings.js | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/features/firehose/index.jsx b/app/javascript/flavours/glitch/features/firehose/index.jsx index 19bb6d791..9db45a0e4 100644 --- a/app/javascript/flavours/glitch/features/firehose/index.jsx +++ b/app/javascript/flavours/glitch/features/firehose/index.jsx @@ -49,6 +49,12 @@ const ColumnSettings = () => { onChange={onChange} label={} /> + } + /> ); @@ -63,6 +69,8 @@ const Firehose = ({ feedType, multiColumn }) => { const onlyMedia = useAppSelector((state) => state.getIn(['settings', 'firehose', 'onlyMedia'], false)); const hasUnread = useAppSelector((state) => state.getIn(['timelines', `${feedType}${onlyMedia ? ':media' : ''}`, 'unread'], 0) > 0); + const allowLocalOnly = useAppSelector((state) => state.getIn(['settings', 'firehose', 'allowLocalOnly'])); + const handlePin = useCallback( () => { switch(feedType) { @@ -70,14 +78,14 @@ const Firehose = ({ feedType, multiColumn }) => { dispatch(addColumn('COMMUNITY', { other: { onlyMedia } })); break; case 'public': - dispatch(addColumn('PUBLIC', { other: { onlyMedia } })); + dispatch(addColumn('PUBLIC', { other: { onlyMedia, allowLocalOnly } })); break; case 'public:remote': dispatch(addColumn('REMOTE', { other: { onlyMedia, onlyRemote: true } })); break; } }, - [dispatch, onlyMedia, feedType], + [dispatch, onlyMedia, feedType, allowLocalOnly], ); const handleLoadMore = useCallback( @@ -87,7 +95,7 @@ const Firehose = ({ feedType, multiColumn }) => { dispatch(expandCommunityTimeline({ onlyMedia })); break; case 'public': - dispatch(expandPublicTimeline({ maxId, onlyMedia })); + dispatch(expandPublicTimeline({ maxId, onlyMedia, allowLocalOnly })); break; case 'public:remote': dispatch(expandPublicTimeline({ maxId, onlyMedia, onlyRemote: true })); @@ -112,7 +120,7 @@ const Firehose = ({ feedType, multiColumn }) => { case 'public': dispatch(expandPublicTimeline({ onlyMedia })); if (signedIn) { - disconnect = dispatch(connectPublicStream({ onlyMedia })); + disconnect = dispatch(connectPublicStream({ onlyMedia, allowLocalOnly })); } break; case 'public:remote': diff --git a/app/javascript/flavours/glitch/locales/en.json b/app/javascript/flavours/glitch/locales/en.json index 07ca42339..555375053 100644 --- a/app/javascript/flavours/glitch/locales/en.json +++ b/app/javascript/flavours/glitch/locales/en.json @@ -52,6 +52,7 @@ "empty_column.follow_recommendations": "Looks like no suggestions could be generated for you. You can try using search to look for people you might know or explore trending hashtags.", "endorsed_accounts_editor.endorsed_accounts": "Featured accounts", "favourite_modal.combo": "You can press {combo} to skip this next time", + "firehose.column_settings.allow_local_only": "Show local-only posts in \"All\"", "follow_recommendations.done": "Done", "follow_recommendations.heading": "Follow people you'd like to see posts from! Here are some suggestions.", "follow_recommendations.lead": "Posts from people you follow will show up in chronological order on your home feed. Don't be afraid to make mistakes, you can unfollow people just as easily any time!", diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js index 0f038670e..fcf72a0b1 100644 --- a/app/javascript/flavours/glitch/reducers/settings.js +++ b/app/javascript/flavours/glitch/reducers/settings.js @@ -86,6 +86,7 @@ const initialState = ImmutableMap({ firehose: ImmutableMap({ onlyMedia: false, + allowLocalOnly: true, }), community: ImmutableMap({