refactor(feed): comment out source filter in the feed
This commit is contained in:
parent
db5b2d0a9c
commit
221b8b2050
@ -47,34 +47,37 @@ export const FeedFilter = React.memo(
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
{/* source filter options */}
|
{/* source filter options */}
|
||||||
<Dropdown
|
{/* show only if not posts tabs */}
|
||||||
label={
|
{tab !== 2 && (
|
||||||
filterOptions.source === window.location.host
|
<Dropdown
|
||||||
? `Show From: ${filterOptions.source}`
|
label={
|
||||||
: 'Show All'
|
filterOptions.source === window.location.host
|
||||||
}
|
? `Show From: ${filterOptions.source}`
|
||||||
>
|
: 'Show All'
|
||||||
<Option
|
|
||||||
onClick={() =>
|
|
||||||
setFilterOptions((prev) => ({
|
|
||||||
...prev,
|
|
||||||
source: window.location.host
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Show From: {window.location.host}
|
<Option
|
||||||
</Option>
|
onClick={() =>
|
||||||
<Option
|
setFilterOptions((prev) => ({
|
||||||
onClick={() =>
|
...prev,
|
||||||
setFilterOptions((prev) => ({
|
source: window.location.host
|
||||||
...prev,
|
}))
|
||||||
source: 'Show All'
|
}
|
||||||
}))
|
>
|
||||||
}
|
Show From: {window.location.host}
|
||||||
>
|
</Option>
|
||||||
Show All
|
<Option
|
||||||
</Option>
|
onClick={() =>
|
||||||
</Dropdown>
|
setFilterOptions((prev) => ({
|
||||||
|
...prev,
|
||||||
|
source: 'Show All'
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Show All
|
||||||
|
</Option>
|
||||||
|
</Dropdown>
|
||||||
|
)}
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -68,15 +68,16 @@ export const FeedTabPosts = () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Filter source
|
// Filter source
|
||||||
_notes = _notes.filter(
|
// TODO: Enable source/client filter
|
||||||
(n) =>
|
// _notes = _notes.filter(
|
||||||
!(
|
// (n) =>
|
||||||
filterOptions.source === window.location.host &&
|
// !(
|
||||||
n
|
// filterOptions.source === window.location.host &&
|
||||||
.getMatchingTags('l')
|
// n
|
||||||
.some((l) => l[1] === window.location.host && l[2] === 'source')
|
// .getMatchingTags('l')
|
||||||
)
|
// .some((l) => l[1] === window.location.host && l[2] === 'source')
|
||||||
)
|
// )
|
||||||
|
// )
|
||||||
|
|
||||||
// Filter reply events
|
// Filter reply events
|
||||||
_notes = _notes.filter((n) => n.getMatchingTags('e').length === 0)
|
_notes = _notes.filter((n) => n.getMatchingTags('e').length === 0)
|
||||||
@ -85,7 +86,7 @@ export const FeedTabPosts = () => {
|
|||||||
|
|
||||||
showing > 0 && _notes.splice(showing)
|
showing > 0 && _notes.splice(showing)
|
||||||
return _notes
|
return _notes
|
||||||
}, [filterOptions.nsfw, filterOptions.source, notes, showing])
|
}, [filterOptions.nsfw, notes, showing])
|
||||||
|
|
||||||
if (!userPubkey) return null
|
if (!userPubkey) return null
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user