Handle post deletions by removing from active views (close #37)
This commit is contained in:
parent
ace0e6bfd9
commit
ebc2033d18
7 changed files with 59 additions and 4 deletions
|
@ -31,8 +31,9 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
|
||||
useEffect(() => {
|
||||
let aborted = false
|
||||
const feedCleanup = uiState.feed.registerListeners()
|
||||
if (!visible) {
|
||||
return
|
||||
return feedCleanup
|
||||
}
|
||||
if (hasSetup) {
|
||||
uiState.update()
|
||||
|
@ -45,6 +46,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
}
|
||||
return () => {
|
||||
aborted = true
|
||||
feedCleanup()
|
||||
}
|
||||
}, [visible, params.name, store])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue