* Fix profile screen performance on android and remove dead code * Correctly handle android hardware back btn * Fix EditProfile modal for android * Fix lint
11 lines
358 B
TypeScript
11 lines
358 B
TypeScript
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())
|
|
}
|