fix: userActions in feed store
This commit is contained in:
@@ -33,6 +33,13 @@ class FeedActions {
|
||||
feed.errorAt = null
|
||||
}
|
||||
if (feed.id) {
|
||||
if (feed.owner) {
|
||||
userActions.upsert(feed.owner as UserModel)
|
||||
}
|
||||
if (feed.tipUsers) {
|
||||
userActions.upsert(feed.tipUsers)
|
||||
}
|
||||
|
||||
// Not all API return these fields, so merging is needed here.
|
||||
const optionalFields = ["owner", "tipUsers"] as const
|
||||
optionalFields.forEach((field) => {
|
||||
@@ -41,13 +48,6 @@ class FeedActions {
|
||||
}
|
||||
})
|
||||
|
||||
if (feed.owner) {
|
||||
userActions.upsert(feed.owner as UserModel)
|
||||
}
|
||||
if (feed.tipUsers) {
|
||||
userActions.upsert(feed.tipUsers)
|
||||
}
|
||||
|
||||
state.feeds[feed.id] = feed
|
||||
} else {
|
||||
// Store temp feed in memory
|
||||
|
||||
Reference in New Issue
Block a user