user profile btn in social nav now only is active for current logged in user, added NSFW tag for admin tagged ones, mod search under a specific game, search term and some filters added to url, filter state is saved locally in cache, user search now works #108
@ -22,6 +22,15 @@ export const useFilteredMods = (
|
|||||||
) => {
|
) => {
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
const nsfwFilter = (mods: ModDetails[]) => {
|
const nsfwFilter = (mods: ModDetails[]) => {
|
||||||
|
// Add nsfw tag to mods included in nsfwList
|
||||||
|
if (filterOptions.nsfw !== NSFWFilter.Hide_NSFW) {
|
||||||
|
mods = mods.map((mod) => {
|
||||||
|
return !mod.nsfw && nsfwList.includes(mod.aTag)
|
||||||
|
? { ...mod, nsfw: true }
|
||||||
|
: mod
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Determine the filtering logic based on the NSFW filter option
|
// Determine the filtering logic based on the NSFW filter option
|
||||||
switch (filterOptions.nsfw) {
|
switch (filterOptions.nsfw) {
|
||||||
case NSFWFilter.Hide_NSFW:
|
case NSFWFilter.Hide_NSFW:
|
||||||
|
Loading…
Reference in New Issue
Block a user