Skip to content

Commit 6f3aa95

Browse files
MRN-908
1 parent f7b97a6 commit 6f3aa95

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/SDK/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export const fetchMessagesFromSDK = async ({ fromUserJId, forceGetFromSDK = fals
121121
toJid: fromUserJId,
122122
lastMessageId,
123123
size: config.chatMessagesSizePerPage,
124-
source: 'db',
125124
});
126125
if (statusCode === 200) {
127126
let hasEqualDataFetched = data.length === config.chatMessagesSizePerPage;

src/components/ReplyContainer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import ReplyImage from './ReplyImage';
1212
import ReplyLocation from './ReplyLocation';
1313
import ReplyText from './ReplyText';
1414
import ReplyVideo from './ReplyVideo';
15-
import { useReplyMessage } from '../redux/reduxHook';
15+
import { useBlockedStatus, useReplyMessage } from '../redux/reduxHook';
1616

1717
function ReplyContainer({ chatUser }) {
1818
const stringSet = getStringSet();
1919
const userId = getUserIdFromJid(chatUser);
2020
const replyMessage = useReplyMessage(userId) || {};
2121
const dispatch = useDispatch();
22+
const blockedStaus = useBlockedStatus(userId);
2223
const { msgBody = {}, deleteStatus = 0, recallStatus = 0, msgBody: { message_type = '' } = {} } = replyMessage;
2324
const handleCloseReplyContainer = () => {
2425
dispatch(setReplyMessage({ userId, message: {} }));
@@ -77,7 +78,7 @@ function ReplyContainer({ chatUser }) {
7778
}
7879
};
7980

80-
if (Object.keys(replyMessage).length === 0) {
81+
if (Object.keys(replyMessage).length === 0 || blockedStaus) {
8182
return null;
8283
}
8384

src/helpers/chatHelpers.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
GalleryIcon,
2727
HeadSetIcon,
2828
LocationIcon,
29-
LogIcon,
3029
NotificationSettingsIcon,
3130
ProfileIcon,
3231
SandTimer,
@@ -42,7 +41,7 @@ import {
4241
requestStoragePermission,
4342
} from '../common/permissions';
4443
import { changeTimeFormat } from '../common/timeStamp';
45-
import { cancelAudioRecord } from '../components/ChatInput';
44+
import { stopAudioRecord } from '../components/ChatInput';
4645
import { conversationFlatListRef } from '../components/ConversationList';
4746
import config from '../config/config';
4847
import {
@@ -84,7 +83,7 @@ import {
8483
toggleIsChatSearching,
8584
updateMediaStatus,
8685
} from '../redux/chatMessageDataSlice';
87-
import { setReplyMessage, setTextMessage } from '../redux/draftSlice';
86+
import { setReplyMessage } from '../redux/draftSlice';
8887
import {
8988
clearRecentChatData,
9089
deleteMessagesForEveryoneInRecentChat,
@@ -1442,9 +1441,7 @@ export const handleUpdateBlockUser = (userId, isBlocked, chatUser) => async () =
14421441
if (isBlocked) {
14431442
const res = await SDK.blockUser(chatUser);
14441443
if (res.statusCode === 200) {
1445-
cancelAudioRecord();
1446-
store.dispatch(setReplyMessage({ userId, message: {} }));
1447-
store.dispatch(setTextMessage({ userId, message: '' }));
1444+
stopAudioRecord();
14481445
showToast(`You have blocked ${getUserNameFromStore(userId)}`);
14491446
store.dispatch(updateBlockUser({ userId, isBlocked }));
14501447
} else {

0 commit comments

Comments
 (0)