parent
fcea27ea0b
commit
54706a0437
|
@ -225,10 +225,22 @@ export class NotificationsFeedItemModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
setAdditionalData(additionalPost: AppBskyFeedDefs.PostView) {
|
setAdditionalData(additionalPost: AppBskyFeedDefs.PostView) {
|
||||||
this.additionalPost = PostThreadModel.fromPostView(
|
if (this.additionalPost) {
|
||||||
this.rootStore,
|
this.additionalPost._replaceAll({
|
||||||
additionalPost,
|
success: true,
|
||||||
)
|
headers: {},
|
||||||
|
data: {
|
||||||
|
thread: {
|
||||||
|
post: additionalPost,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.additionalPost = PostThreadModel.fromPostView(
|
||||||
|
this.rootStore,
|
||||||
|
additionalPost,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,15 @@ export const Post = observer(function Post({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initView || view?.params.uri === uri) {
|
if (initView || view?.params.uri === uri) {
|
||||||
return // no change needed? or trigger refresh?
|
if (initView !== view) {
|
||||||
|
setView(initView)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
const newView = new PostThreadModel(store, {uri, depth: 0})
|
const newView = new PostThreadModel(store, {uri, depth: 0})
|
||||||
setView(newView)
|
setView(newView)
|
||||||
newView.setup().catch(err => store.log.error('Failed to fetch post', err))
|
newView.setup().catch(err => store.log.error('Failed to fetch post', err))
|
||||||
}, [initView, uri, view?.params.uri, store])
|
}, [initView, setView, uri, view, view?.params.uri, store])
|
||||||
|
|
||||||
// deleted
|
// deleted
|
||||||
// =
|
// =
|
||||||
|
|
Loading…
Reference in New Issue