fix: userActions in feed store
This commit is contained in:
parent
971f81d25d
commit
8da4fb71d9
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue