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:
Aman Harwara
2022-12-04 16:49:46 +05:30
parent 90e10c76f7
commit 07cb00a815
7 changed files with 32 additions and 17 deletions

View File

@@ -14,6 +14,7 @@ import {
import { AppPaneId } from './AppPaneMetadata'
import { PaneController } from '../../Controllers/PaneController/PaneController'
import { observer } from 'mobx-react-lite'
import { PaneLayout } from '@/Controllers/PaneController/PaneLayout'
type ResponsivePaneData = {
selectedPane: AppPaneId
@@ -84,7 +85,7 @@ const ResponsivePaneProvider = ({ paneController, children }: ProviderProps) =>
currentSelectedPaneRef.current === AppPaneId.Editor ||
currentSelectedPaneRef.current === AppPaneId.Navigation
) {
toggleAppPane(AppPaneId.Items)
paneController.setPaneLayout(PaneLayout.ItemSelection)
return true
} else {
return false
@@ -95,7 +96,7 @@ const ResponsivePaneProvider = ({ paneController, children }: ProviderProps) =>
removeListener()
}
}
}, [addAndroidBackHandler, currentSelectedPaneRef, toggleAppPane])
}, [addAndroidBackHandler, currentSelectedPaneRef, paneController])
const contextValue = useMemo(
(): ResponsivePaneData => ({