Skip to content

Commit

Permalink
fix: menu button not unloading chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Sep 22, 2024
1 parent 8ce3c80 commit acd0727
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/components/ChatMenu/OptionsMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AntDesign, Ionicons } from '@expo/vector-icons'
import { Characters, Style } from '@globals'
import { Characters, Chats, Style } from '@globals'
import { useRouter } from 'expo-router'
import { View, Text, StyleSheet } from 'react-native'
import {
Expand Down Expand Up @@ -29,10 +29,13 @@ const OptionsMenu: React.FC<OptionsMenuProps> = ({ menuRef }) => {
unloadCharacter: state.unloadCard,
}))

const unloadChat = Chats.useChat((state) => state.reset)

const menuoptions: MenuData[] = [
{
callback: () => {
unloadCharacter()
unloadChat()
},
text: 'Main Menu',
button: 'back',
Expand Down

0 comments on commit acd0727

Please sign in to comment.