about summary refs log tree commit diff
path: root/src/state/shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/shell')
-rw-r--r--src/state/shell/minimal-mode.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/state/shell/minimal-mode.tsx b/src/state/shell/minimal-mode.tsx
index 05999db85..6e608daf4 100644
--- a/src/state/shell/minimal-mode.tsx
+++ b/src/state/shell/minimal-mode.tsx
@@ -1,5 +1,5 @@
 import React from 'react'
-import {SharedValue, useSharedValue, withSpring} from 'react-native-reanimated'
+import {cancelAnimation, SharedValue, useSharedValue, withSpring} from 'react-native-reanimated'
 
 type StateContext = SharedValue<number>
 type SetContext = (v: boolean) => void
@@ -17,6 +17,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
   const setMode = React.useCallback(
     (v: boolean) => {
       'worklet'
+      // Cancel any existing animation
+      cancelAnimation(mode)
       mode.value = withSpring(v ? 1 : 0, {
         overshootClamping: true,
       })