mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-29 00:10:50 +00:00
Add LatestWithReplies after Latest
This commit is contained in:
parent
b213a13d42
commit
c5dfe5c411
@ -409,8 +409,16 @@ export const SettingsProvider = (props: { children: ContextChildren }) => {
|
||||
if (!fs.find(f => f.hex === feedLatest.hex && f.includeReplies === undefined)) {
|
||||
fs.push(feedLatest);
|
||||
}
|
||||
|
||||
if (!fs.find(f => f.hex === feedLatestWithReplies.hex && f.includeReplies === true)) {
|
||||
fs.push(feedLatestWithReplies);
|
||||
const latestIndex = fs.findIndex(f => f.hex === feedLatest.hex && f.includeReplies === undefined);
|
||||
|
||||
if (latestIndex >= 0) {
|
||||
fs.splice(latestIndex + 1, 0, feedLatestWithReplies);
|
||||
}
|
||||
else {
|
||||
fs.push(feedLatestWithReplies);
|
||||
}
|
||||
}
|
||||
|
||||
setAvailableFeeds(fs, true);
|
||||
|
@ -51,7 +51,7 @@ export const removeFromAvailableFeeds = (
|
||||
feed: PrimalFeed,
|
||||
feeds: PrimalFeed[],
|
||||
) => {
|
||||
const newFeeds = feeds.filter(f => f.hex !== feed.hex);
|
||||
const newFeeds = feeds.filter(f => f.hex !== feed.hex || f.includeReplies !== feed.includeReplies);
|
||||
|
||||
saveFeeds(pubkey, newFeeds);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user