From 6e4e580402710d051c981e6a08735c019cf1b0cc Mon Sep 17 00:00:00 2001 From: daniyal Date: Mon, 18 Nov 2024 15:33:55 +0500 Subject: [PATCH] fix: update wot filter to remove mine_only for non admin users --- src/components/ModsFilter.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ModsFilter.tsx b/src/components/ModsFilter.tsx index 2a5384c..806fabe 100644 --- a/src/components/ModsFilter.tsx +++ b/src/components/ModsFilter.tsx @@ -116,15 +116,17 @@ export const ModFilter = React.memo( {Object.values(WOTFilterOptions).map((item, index) => { // when user is not logged in if ( - (item === WOTFilterOptions.Site_And_Mine || - item === WOTFilterOptions.Mine_Only) && + item === WOTFilterOptions.Site_And_Mine && !userState.auth ) { return null } // when logged in user not admin - if (item === WOTFilterOptions.None) { + if ( + item === WOTFilterOptions.None || + item === WOTFilterOptions.Mine_Only + ) { const isAdmin = userState.user?.npub === import.meta.env.VITE_REPORTING_NPUB -- 2.34.1