Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: chat not visible, not loading #223

Merged
merged 7 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/hooks/custom-hooks/useSendbird.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ const useSendbird = (orderId: string | undefined, isErrorOrderInfo: boolean, cha
useEffect(() => {
// if the user has not created a chat URL for the order yet, create one using p2p_create_chat endpoint
// chatChannelUrl is received from order details, hence check if chat url was already created using p2p_create_chat
if (!chatChannel?.url && sendbirdServiceToken?.app_id && orderId) {
// initialise Chat only if chatchannelurl is already present in order details, but chatChannel is not created in sendbird.
if (!chatChannel?.url && sendbirdServiceToken?.app_id && orderId && chatChannelUrl) {
initialiseChat();
} else if (orderId && !chatChannelUrl && !chatChannel?.url) {
} else if (orderId && !chatChannelUrl && !chatChannel?.url && sendbirdServiceToken?.app_id) {
createChat({
order_id: orderId,
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/orders/screens/OrderDetails/OrderDetails.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.order-details {
overflow: auto;
height: calc(100% - 27rem);
height: calc(100% - 17rem);

@include mobile-or-tablet-screen {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/orders/screens/OrderDetails/OrderDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const OrderDetails = () => {

return (
<OrderDetailsProvider value={{ isErrorOrderInfo: !!error, orderDetails }}>
<div className='w-full'>
<div className='h-full w-full'>
<PageReturn onClick={onReturn} pageTitle={headerText} weight='bold' />
<div className='order-details'>
{shouldShowLostFundsBanner && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

&__full-page {
position: absolute;
top: 0;
top: 1rem;
left: 0;
z-index: 1;
height: calc(100vh - 8rem);
height: calc(100% - 9rem);

& .mobile-wrapper {
&__body {
Expand All @@ -35,11 +35,13 @@
}

&--closed {
height: calc(100vh - 5rem);
height: calc(100% - 5rem);

& .mobile-wrapper {
&__footer {
padding: 1.6rem;
margin-top: -1rem;
background-color: #fff;
}
}
}
Expand Down
Loading