Android fixes (#515)
* Fix profile screen performance on android and remove dead code * Correctly handle android hardware back btn * Fix EditProfile modal for android * Fix lint
This commit is contained in:
parent
eb6b36be61
commit
d35f7c1f1a
11 changed files with 273 additions and 594 deletions
11
src/lib/routes/back-handler.ts
Normal file
11
src/lib/routes/back-handler.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import {BackHandler} from 'react-native'
|
||||
import {RootStoreModel} from 'state/index'
|
||||
|
||||
export function onBack(cb: () => boolean): () => void {
|
||||
const subscription = BackHandler.addEventListener('hardwareBackPress', cb)
|
||||
return () => subscription.remove()
|
||||
}
|
||||
|
||||
export function init(store: RootStoreModel) {
|
||||
onBack(() => store.shell.closeAnyActiveElement())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue