|
|
@ -18,8 +18,7 @@ const Conversations = ({ mobile }) => {
|
|
|
|
const navigate = useNavigate();
|
|
|
|
const navigate = useNavigate();
|
|
|
|
const userId = useAuthStore((state) => state.loginUser.userId);
|
|
|
|
const userId = useAuthStore((state) => state.loginUser.userId);
|
|
|
|
const initialState = useConversationStore((state) => state.initialState);
|
|
|
|
const initialState = useConversationStore((state) => state.initialState);
|
|
|
|
const activeConversations = useConversationStore((state) => state.activeConversations);
|
|
|
|
const [currentConversation, setCurrentConversation] = useConversationStore((state) => [state.currentConversation, state.setCurrentConversation]);
|
|
|
|
const [currentConversation, setCurrentConversation, updateCurrentConversation] = useConversationStore((state) => [state.currentConversation, state.setCurrentConversation, state.updateCurrentConversation]);
|
|
|
|
|
|
|
|
const conversationsList = useConversationStore((state) => state.conversationsList);
|
|
|
|
const conversationsList = useConversationStore((state) => state.conversationsList);
|
|
|
|
const addToConversationList = useConversationStore((state) => state.addToConversationList);
|
|
|
|
const addToConversationList = useConversationStore((state) => state.addToConversationList);
|
|
|
|
const delConversationitem = useConversationStore((state) => state.delConversationitem);
|
|
|
|
const delConversationitem = useConversationStore((state) => state.delConversationitem);
|
|
|
@ -27,6 +26,15 @@ const Conversations = ({ mobile }) => {
|
|
|
|
const [tabSelectedConversation, setTabSelectedConversation] = useState({});
|
|
|
|
const [tabSelectedConversation, setTabSelectedConversation] = useState({});
|
|
|
|
const [tabCnt, setTabCnt] = useState(-1);
|
|
|
|
const [tabCnt, setTabCnt] = useState(-1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
if (mobile !== undefined) {
|
|
|
|
|
|
|
|
setCurrentConversation({});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return () => {};
|
|
|
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [dataSource, setDataSource] = useState(conversationsList);
|
|
|
|
const [dataSource, setDataSource] = useState(conversationsList);
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
setDataSource(conversationsList);
|
|
|
|
setDataSource(conversationsList);
|
|
|
|