| @@ -39,6 +39,7 @@ import { | |||
| toggleDeleteOfferModal, | |||
| toggleEditOfferModal, | |||
| } from "../../../store/actions/modal/modalActions"; | |||
| import { fetchChats } from "../../../store/actions/chat/chatActions"; | |||
| const ItemDetailsCard = (props) => { | |||
| // const offer = props.offer; | |||
| @@ -75,6 +76,7 @@ const ItemDetailsCard = (props) => { | |||
| const date = formatDateLocale(new Date(offer?._created)); | |||
| const startExchange = () => { | |||
| dispatch(fetchChats({ userId: userId, offerId: props.offer._id })); | |||
| startChat(chats, offer, userId); | |||
| }; | |||
| @@ -108,7 +110,7 @@ const ItemDetailsCard = (props) => { | |||
| ); | |||
| }; | |||
| console.log(props) | |||
| console.log(props); | |||
| return ( | |||
| <> | |||
| <ItemDetailsCardContainer | |||
| @@ -21,9 +21,7 @@ import { fetchOneOffer } from "../../store/actions/offers/offersActions"; | |||
| import SkeletonDirectChat from "./SkeletonDirectChat/SkeletonDirectChat"; | |||
| import { selectIsLoadingByActionType } from "../../store/selectors/loadingSelectors"; | |||
| import { CHAT_SCOPE } from "../../store/actions/chat/chatActionConstants"; | |||
| import { | |||
| selectUserId, | |||
| } from "../../store/selectors/loginSelectors"; | |||
| import { selectUserId } from "../../store/selectors/loginSelectors"; | |||
| import { | |||
| acceptExchangeSocket, | |||
| addMessageListener, | |||
| @@ -13,7 +13,7 @@ import { useTranslation } from "react-i18next"; | |||
| const UserButton = (props) => { | |||
| const location = useLocation(); | |||
| const {t} = useTranslation(); | |||
| const { t } = useTranslation(); | |||
| const [userPopoverOpen, setUserPopoverOpen] = useState(false); | |||
| const [userAnchorEl, setUserAnchorEl] = useState(null); | |||
| @@ -40,7 +40,7 @@ const UserButton = (props) => { | |||
| color: selectedTheme.colors.primaryPurple, | |||
| }} | |||
| > | |||
| <AccountCircle /> | |||
| <AccountCircle onClick={openUserPopover} /> | |||
| </IconButton> | |||
| </UserButtonContainer> | |||
| <PopoverComponent | |||
| @@ -153,7 +153,7 @@ function* startNewChat(payload) { | |||
| _id: newChatId, | |||
| message: { | |||
| user: { | |||
| _id: userId | |||
| _id: userId, | |||
| }, | |||
| text: payload.payload.message, | |||
| _created: new Date().toISOString(), | |||