Feed feedback and fixes #231

Merged
enes merged 22 commits from feat/131-feed-issues into staging 2025-02-21 14:06:33 +00:00
2 changed files with 40 additions and 36 deletions
Showing only changes of commit 221b8b2050 - Show all commits

View File

@ -47,34 +47,37 @@ export const FeedFilter = React.memo(
</Dropdown>
{/* source filter options */}
<Dropdown
label={
filterOptions.source === window.location.host
? `Show From: ${filterOptions.source}`
: 'Show All'
}
>
<Option
onClick={() =>
setFilterOptions((prev) => ({
...prev,
source: window.location.host
}))
{/* show only if not posts tabs */}
{tab !== 2 && (
<Dropdown
label={
filterOptions.source === window.location.host
? `Show From: ${filterOptions.source}`
: 'Show All'
}
>
Show From: {window.location.host}
</Option>
<Option
onClick={() =>
setFilterOptions((prev) => ({
...prev,
source: 'Show All'
}))
}
>
Show All
</Option>
</Dropdown>
<Option
onClick={() =>
setFilterOptions((prev) => ({
...prev,
source: window.location.host
}))
}
>
Show From: {window.location.host}
</Option>
<Option
onClick={() =>
setFilterOptions((prev) => ({
...prev,
source: 'Show All'
}))
}
>
Show All
</Option>
</Dropdown>
)}
{children}
</Filter>

View File

@ -68,15 +68,16 @@ export const FeedTabPosts = () => {
)
// Filter source
_notes = _notes.filter(
(n) =>
!(
filterOptions.source === window.location.host &&
n
.getMatchingTags('l')
.some((l) => l[1] === window.location.host && l[2] === 'source')
)
)
// TODO: Enable source/client filter
// _notes = _notes.filter(
// (n) =>
// !(
// filterOptions.source === window.location.host &&
// n
// .getMatchingTags('l')
// .some((l) => l[1] === window.location.host && l[2] === 'source')
// )
// )
// Filter reply events
_notes = _notes.filter((n) => n.getMatchingTags('e').length === 0)
@ -85,7 +86,7 @@ export const FeedTabPosts = () => {
showing > 0 && _notes.splice(showing)
return _notes
}, [filterOptions.nsfw, filterOptions.source, notes, showing])
}, [filterOptions.nsfw, notes, showing])
if (!userPubkey) return null