aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManti <67705577+mantikafasi@users.noreply.github.com>2023-08-10 03:28:46 +0300
committerGitHub <noreply@github.com>2023-08-10 00:28:46 +0000
commitc96a1a9998bdde104baff632aad32a4d010e6a3f (patch)
tree75a018b853daf92a0f0e15ed2c290ce27c647467 /src
parent8b6c8bc0ecedfea82370a253050657e5ca9d48f1 (diff)
downloadVencord-c96a1a9998bdde104baff632aad32a4d010e6a3f.tar.gz
Vencord-c96a1a9998bdde104baff632aad32a4d010e6a3f.tar.bz2
Vencord-c96a1a9998bdde104baff632aad32a4d010e6a3f.zip
[ReviewDB] hide blocked users (#1626)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/reviewDB/components/ReviewsView.tsx5
-rw-r--r--src/plugins/reviewDB/settings.tsx5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx
index bd264fa..ada0fa0 100644
--- a/src/plugins/reviewDB/components/ReviewsView.tsx
+++ b/src/plugins/reviewDB/components/ReviewsView.tsx
@@ -19,7 +19,7 @@
import { classes } from "@utils/misc";
import { useAwaiter, useForceUpdater } from "@utils/react";
import { findByPropsLazy } from "@webpack";
-import { Forms, React, UserStore } from "@webpack/common";
+import { Forms, React, RelationshipStore, UserStore } from "@webpack/common";
import type { KeyboardEvent } from "react";
import { Review } from "../entities";
@@ -60,6 +60,9 @@ export default function ReviewsView({
fallbackValue: null,
deps: [refetchSignal, signal, page],
onSuccess: data => {
+ if (settings.store.hideBlockedUsers)
+ data!.reviews = data!.reviews?.filter(r => !RelationshipStore.isBlocked(r.sender.discordID));
+
scrollToTop?.();
onFetchReviews(data!);
}
diff --git a/src/plugins/reviewDB/settings.tsx b/src/plugins/reviewDB/settings.tsx
index fb5b362..e318bc7 100644
--- a/src/plugins/reviewDB/settings.tsx
+++ b/src/plugins/reviewDB/settings.tsx
@@ -48,6 +48,11 @@ export const settings = definePluginSettings({
description: "Hide timestamps on reviews",
default: false,
},
+ hideBlockedUsers: {
+ type: OptionType.BOOLEAN,
+ description: "Hide reviews from blocked users",
+ default: true,
+ },
website: {
type: OptionType.COMPONENT,
description: "ReviewDB website",