diff options
author | Ansh <anshnanda10@gmail.com> | 2023-09-29 10:49:59 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 07:49:59 +0400 |
commit | 04fda0f1429d26586d308a619f91d4504bdd3521 (patch) | |
tree | ee215dddc5bfd6385605383a48ca60e3e6f9631f /src/view/shell/index.tsx | |
parent | 1f60e1a7486013ad84dcc386d226f4225b67c1d3 (diff) | |
download | voidsky-04fda0f1429d26586d308a619f91d4504bdd3521.tar.zst |
Fix 1405 handle android back button in composer (#1446)
* handle android back button in composer * improve backHandler error handling * simplify composer onClose functionality
Diffstat (limited to 'src/view/shell/index.tsx')
-rw-r--r-- | src/view/shell/index.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/view/shell/index.tsx b/src/view/shell/index.tsx index e313450f1..3119715e9 100644 --- a/src/view/shell/index.tsx +++ b/src/view/shell/index.tsx @@ -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} |