Merge pull request 'fix: update wot filter to remove mine_only for non admin users' (#152) from wot-fixes into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 53s

Reviewed-on: #152
This commit is contained in:
freakoverse 2024-11-18 11:02:09 +00:00
commit 432d182d15

View File

@ -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