Skip to content

Commit

Permalink
fix: chat text not updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Dec 27, 2024
1 parent f0edbbe commit 9b52036
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/components/ChatMenu/ChatWindow/EditorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const EditorModal: React.FC<EditorProps> = ({ id, isLastMessage, setEditMode, ed
<Animated.View exiting={SlideOutDown.duration(100)} style={styles.editorContainer}>
<View style={styles.topText}>
<Text style={styles.nameText}>{entry?.name}</Text>
<Text style={styles.timeText}>{swipe.send_date.toLocaleTimeString()}</Text>
<Text style={styles.timeText}>{swipe?.send_date.toLocaleTimeString()}</Text>
</View>

<TextInput
Expand Down
10 changes: 7 additions & 3 deletions constants/Chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,13 @@ export namespace Chats {
export const useSwipeData = (index: number) => {
const message = useEntryData(index)
const swipe_index = message.swipe_id
const swipe = message.swipes?.[swipe_index]
const swipeText = swipe?.swipe
const swipeId = swipe?.id
const { swipe, swipeText, swipeId } = useChatState(
useShallow((state) => ({
swipe: state?.data?.messages?.[index].swipes[swipe_index],
swipeText: state?.data?.messages?.[index].swipes[swipe_index].swipe ?? '',
swipeId: state?.data?.messages?.[index].swipes[swipe_index].id,
}))
)
return { swipeId, swipe, swipeText }
}

Expand Down

0 comments on commit 9b52036

Please sign in to comment.