Fix 1405 handle android back button in composer (#1446)
* handle android back button in composer * improve backHandler error handling * simplify composer onClose functionality
This commit is contained in:
parent
1f60e1a748
commit
04fda0f142
6 changed files with 37 additions and 17 deletions
|
@ -44,7 +44,10 @@ const ShellInner = observer(function ShellInnerImpl() {
|
|||
)
|
||||
const canGoBack = useNavigationState(state => !isStateAtTabRoot(state))
|
||||
React.useEffect(() => {
|
||||
backHandler.init(store)
|
||||
const listener = backHandler.init(store)
|
||||
return () => {
|
||||
listener()
|
||||
}
|
||||
}, [store])
|
||||
|
||||
return (
|
||||
|
@ -68,7 +71,6 @@ const ShellInner = observer(function ShellInnerImpl() {
|
|||
</View>
|
||||
<Composer
|
||||
active={store.shell.isComposerActive}
|
||||
onClose={() => store.shell.closeComposer()}
|
||||
winHeight={winDim.height}
|
||||
replyTo={store.shell.composerOpts?.replyTo}
|
||||
onPost={store.shell.composerOpts?.onPost}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue