make sure state is being synced across components

This commit is contained in:
Ansh Nanda 2023-05-16 16:07:07 -07:00
parent f2e39d8ad2
commit 3f41d3db26
6 changed files with 39 additions and 38 deletions

View file

@ -64,11 +64,9 @@ export const CustomFeed = withAuthRequired(
style={[styles.saveButton]}
onPress={() => {
if (currentFeed?.data.viewer?.saved) {
currentFeed?.unsave()
rootStore.me.savedFeeds.removeFeed(currentFeed!.data.uri)
rootStore.me.savedFeeds.unsave(currentFeed!)
} else {
currentFeed!.save()
rootStore.me.savedFeeds.addFeed(currentFeed!)
rootStore.me.savedFeeds.save(currentFeed!)
}
}}
label={currentFeed?.data.viewer?.saved ? 'Unsave' : 'Save'}

View file

@ -112,7 +112,7 @@ export const HomeScreen = withAuthRequired(
feed={algoFeed}
renderEmptyState={renderWhatsHotEmptyState}
/>
{store.me.savedFeeds.feeds.map((f, index) => {
{store.me.savedFeeds.pinned.map((f, index) => {
return (
<FeedPage
key={String(2 + index + 1)}