Add LatestWithReplies after Latest

This commit is contained in:
Bojan Mojsilovic 2023-09-29 13:05:46 +02:00
parent b213a13d42
commit c5dfe5c411
2 changed files with 10 additions and 2 deletions

View File

@ -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);

View File

@ -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);