@@ -10,7 +10,6 @@ import variables from '@styles/variables';
10
10
import CONST from '@src/CONST' ;
11
11
import ONYXKEYS from '@src/ONYXKEYS' ;
12
12
import KeyboardUtils from '@src/utils/keyboard' ;
13
- import usePrevious from './usePrevious' ;
14
13
import useResponsiveLayout from './useResponsiveLayout' ;
15
14
import useWindowDimensions from './useWindowDimensions' ;
16
15
@@ -71,14 +70,8 @@ function useSidePanel() {
71
70
const shouldApplySidePanelOffset = isExtraLargeScreenWidth && ! shouldHideSidePanel ;
72
71
const sidePanelOffset = useRef ( new Animated . Value ( shouldApplySidePanelOffset ? variables . sideBarWidth : 0 ) ) ;
73
72
const sidePanelTranslateX = useRef ( new Animated . Value ( shouldHideSidePanel ? sidePanelWidth : 0 ) ) ;
74
- const prevShouldHideSidePanel = usePrevious ( shouldHideSidePanel ) ;
75
73
76
74
useEffect ( ( ) => {
77
- if ( shouldHideSidePanel && prevShouldHideSidePanel ) {
78
- sidePanelTranslateX . current . setValue ( sidePanelWidth ) ;
79
- sidePanelOffset . current . setValue ( shouldApplySidePanelOffset ? variables . sideBarWidth : 0 ) ;
80
- return ;
81
- }
82
75
setIsSidePanelTransitionEnded ( false ) ;
83
76
84
77
Animated . parallel ( [
@@ -93,7 +86,7 @@ function useSidePanel() {
93
86
useNativeDriver : true ,
94
87
} ) ,
95
88
] ) . start ( ( ) => setIsSidePanelTransitionEnded ( true ) ) ;
96
- } , [ shouldHideSidePanel , shouldApplySidePanelOffset , sidePanelWidth , prevShouldHideSidePanel ] ) ;
89
+ } , [ shouldHideSidePanel , shouldApplySidePanelOffset , sidePanelWidth ] ) ;
97
90
98
91
const openSidePanel = useCallback ( ( ) => {
99
92
setIsSidePanelTransitionEnded ( false ) ;
0 commit comments