Fix ignored 'Content Type' filter (#694)

## Issue
After enabling Advanced Filter in Category Pages, the 'Content Type' filter only works for "repost/video/list".

## Root-cause
When `streamType` is not provided, it defaults to 'Video|Audio', making it always "defined":

```
streamType = SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
```

This seem to override the purpose of `defaultStreamType`, which will not be used unless the client explicitly set `streamType=null`, which currently is only being applied for `RECENT_FROM_FOLLOWING[]`.

```
  const streamTypeParam =
    streamType || (CS.FILE_TYPES.includes(contentTypeParam) && contentTypeParam) || defaultStreamType || null;
```
This commit is contained in:
infinite-persistence 2022-01-13 19:03:04 -08:00 committed by GitHub
parent 7affa8b7a1
commit 0d6cd21457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,8 +133,8 @@ function ClaimListDiscover(props: Props) {
claimType,
pageSize,
defaultClaimType,
streamType = SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
defaultStreamType = SIMPLE_SITE ? CS.FILE_VIDEO : undefined, // add param for DEFAULT_STREAM_TYPE
streamType,
defaultStreamType = SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined, // add param for DEFAULT_STREAM_TYPE
freshness,
defaultFreshness = CS.FRESH_WEEK,
renderProperties,