File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { getGalleryImageBorderRadius } from './utils/getGalleryImageBorderRadius
1111
1212import { openUrlSafely } from './utils/openUrlSafely' ;
1313
14+ import { useTranslationContext } from '../../contexts' ;
1415import { useChatConfigContext } from '../../contexts/chatConfigContext/ChatConfigContext' ;
1516import {
1617 ImageGalleryContextValue ,
@@ -29,7 +30,7 @@ import {
2930 useOverlayContext ,
3031} from '../../contexts/overlayContext/OverlayContext' ;
3132import { useTheme } from '../../contexts/themeContext/ThemeContext' ;
32- import { useTranslationContext } from '../../contexts/translationContext/TranslationContext' ;
33+
3334import { useLoadingImage } from '../../hooks/useLoadingImage' ;
3435import { isVideoPlayerAvailable } from '../../native' ;
3536import { FileTypes } from '../../types/types' ;
Original file line number Diff line number Diff line change @@ -97,15 +97,11 @@ export const CreatePollOption = ({
9797 // The sanity check for position cache updated index, is added because after a poll is sent its been reset
9898 // by the composer and it throws an undefined error. This can be removed in future.
9999 useAnimatedReaction (
100- ( ) =>
101- currentOptionPositionsDerived . value . positionCache [ option . id ]
102- ? currentOptionPositionsDerived . value . positionCache [ option . id ] . updatedIndex
103- : 0 ,
100+ ( ) => currentOptionPositionsDerived . value . positionCache [ option . id ] ?. updatedIndex ?? 0 ,
104101 ( currentValue , previousValue ) => {
105102 if ( currentValue !== previousValue ) {
106- const updatedIndex = currentOptionPositionsDerived . value . positionCache [ option . id ]
107- ? currentOptionPositionsDerived . value . positionCache [ option . id ] . updatedIndex
108- : 0 ;
103+ const updatedIndex =
104+ currentOptionPositionsDerived . value . positionCache [ option . id ] ?. updatedIndex ?? 0 ;
109105 top . value = withSpring ( updatedIndex * createPollOptionHeight ) ;
110106 }
111107 } ,
You can’t perform that action at this time.
0 commit comments