Skip to content

Commit

Permalink
bring back freezing on 1 screen away
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Mar 12, 2024
1 parent 0438c8a commit 462e200
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/Navigation/FreezeWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ function FreezeWrapper({keepVisible = false, children}: FreezeWrapperProps) {

useEffect(() => {
const unsubscribe = navigation.addListener('state', () => {
if ((navigation.getState()?.index ?? 0) - (screenIndexRef.current ?? 0) >= 1) {
// if the screen is more than 1 screen away from the current screen, freeze it,
// we don't want to freeze the screen if it's the previous screen because the freeze placeholder
// would be visible at the beginning of the back animation then
if ((navigation.getState()?.index ?? 0) - (screenIndexRef.current ?? 0) > 1) {
setIsScreenBlurred(true);
} else {
setIsScreenBlurred(false);
Expand Down

0 comments on commit 462e200

Please sign in to comment.