fix(mobile): Fixed issue where pressing the back button on editor screen wouldn't switch back to the items list on Android
This commit is contained in:
@@ -34,19 +34,14 @@ const AndroidBackHandlerProvider = ({ application, children }: ProviderProps) =>
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
const removeListener = addAndroidBackHandler(() => {
|
||||
application.setAndroidBackHandlerFallbackListener(() => {
|
||||
const shouldConfirm = (application.getValue(AndroidConfirmBeforeExitKey) as boolean) ?? true
|
||||
|
||||
application.mobileDevice().exitApp(shouldConfirm)
|
||||
|
||||
return true
|
||||
})
|
||||
return () => {
|
||||
if (removeListener) {
|
||||
removeListener()
|
||||
}
|
||||
}
|
||||
}, [addAndroidBackHandler, application])
|
||||
}, [application])
|
||||
|
||||
return (
|
||||
<BackHandlerContext.Provider value={addAndroidBackHandler}>
|
||||
|
||||
Reference in New Issue
Block a user