diff --git a/src/hooks/useFilteredMods.ts b/src/hooks/useFilteredMods.ts index a7654d9..7c46c76 100644 --- a/src/hooks/useFilteredMods.ts +++ b/src/hooks/useFilteredMods.ts @@ -11,6 +11,7 @@ import { } from 'types' import { npubToHex } from 'utils' import { useAppSelector } from './redux' +import { isInWoT } from 'utils/wot' export const useFilteredMods = ( mods: ModDetails[], @@ -23,7 +24,9 @@ export const useFilteredMods = ( }, author?: string | undefined ) => { - const { siteWot, userWot } = useAppSelector((state) => state.wot) + const { siteWot, siteWotLevel, userWot, userWotLevel } = useAppSelector( + (state) => state.wot + ) return useMemo(() => { const nsfwFilter = (mods: ModDetails[]) => { @@ -56,13 +59,18 @@ export const useFilteredMods = ( case WOTFilterOptions.None: return mods case WOTFilterOptions.Site_Only: - return mods.filter((mod) => siteWot.includes(mod.author)) + return mods.filter((mod) => + isInWoT(siteWot, siteWotLevel, mod.author) + ) case WOTFilterOptions.Mine_Only: - return mods.filter((mod) => userWot.includes(mod.author)) + return mods.filter((mod) => + isInWoT(userWot, userWotLevel, mod.author) + ) case WOTFilterOptions.Site_And_Mine: return mods.filter( (mod) => - siteWot.includes(mod.author) || userWot.includes(mod.author) + isInWoT(siteWot, siteWotLevel, mod.author) || + isInWoT(userWot, userWotLevel, mod.author) ) } } @@ -114,6 +122,8 @@ export const useFilteredMods = ( muteLists, nsfwList, siteWot, - userWot + siteWotLevel, + userWot, + userWotLevel ]) } diff --git a/src/layout/header.tsx b/src/layout/header.tsx index 0d0c571..f131dc6 100644 --- a/src/layout/header.tsx +++ b/src/layout/header.tsx @@ -21,7 +21,7 @@ import '../styles/popup.css' import { npubToHex } from '../utils' import logo from '../assets/img/DEG Mods Logo With Text.svg' import placeholder from '../assets/img/DEG Mods Default PP.png' -import { setUserWot } from 'store/reducers/wot' +import { resetUserWot } from 'store/reducers/wot' export const Header = () => { const dispatch = useAppDispatch() @@ -49,7 +49,7 @@ export const Header = () => { if (opts.type === 'logout') { dispatch(setAuth(null)) dispatch(setUser(null)) - dispatch(setUserWot([])) + dispatch(resetUserWot()) } else { dispatch( setAuth({ @@ -381,13 +381,29 @@ const RegisterButtonWithDialog = () => { Browser Extensions (Windows)
- Once you create your "account" on any of these, come back and click login, then sign-in with - extension. Here's a quick video guide, and here's a guide post to help with this process.
-