Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/components/screens/Settings/Content/ContentScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ function ContentScreen({
}
/>
</CSection>
<CSection
header={t("Bot Content")}
footer={t("settings.content.botContent.footer")}
>
<CCell
cellStyle="RightDetail"
title={t("Hide Bot Content")}
backgroundColor={theme.colors.fg}
titleTextColor={theme.colors.textPrimary}
rightDetailColor={theme.colors.textSecondary}
cellAccessoryView={
<Switch
value={settings.hideBotContent}
onValueChange={(v) => onChange("hideBotContent", v)}
/>
}
/>
</CSection>
</TableView>
</ScrollView>
);
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
"blur": "Blur NSFW Content",
"hide": "Hide NSFW Content"
},
"botContent": {
"footer": "Hide all posts that are made from bot accounts"
},
"markRead": {
"header": "MARK READ SETTINGS",
"onPostOpen": "Mark Read on Post Open",
Expand Down
6 changes: 5 additions & 1 deletion src/stores/feeds/actions/setFeedPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import { useSettingsStore } from "@src/stores/settings/settingsStore";
import { useFeedsStore } from "../feedsStore";

const setFeedPosts = (feedKey: string, posts: PostView[]) => {
const { hideNsfw } = useSettingsStore.getState().settings;
const { hideNsfw, hideBotContent } = useSettingsStore.getState().settings;

if (hideNsfw) {
posts = posts.filter((p) => !p.post.nsfw && !p.community.nsfw);
}

if (hideBotContent) {
posts = posts.filter((p) => !p.creator.bot_account);
}

useFeedsStore.setState((state) => {
const prev = state.feeds.get(feedKey);

Expand Down
2 changes: 2 additions & 0 deletions src/stores/settings/settingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface SettingsState {
commentSwipeLeftSecond: "Reply" | "Save" | "Collapse" | "None";
showCommentJumpButton: boolean;
commentJumpPlacement: "bottom left" | "bottom right" | "bottom center";
hideBotContent: boolean;
}

const initialState: SettingsState = {
Expand Down Expand Up @@ -108,6 +109,7 @@ const initialState: SettingsState = {
commentSwipeLeftSecond: "None",
showCommentJumpButton: true,
commentJumpPlacement: "bottom right",
hideBotContent: false,
};

export const useSettingsStore = create(
Expand Down