@droppii-org/chat-sdk 0.1.41 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AAUjC,eAAO,MAAM,kBAAkB,eAgB9B,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,iBAAiB,MAAM,EACvB,oBAAoB,MAAM,EAC1B,iBAAc;;;;;
|
|
1
|
+
{"version":3,"file":"useMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AAUjC,eAAO,MAAM,kBAAkB,eAgB9B,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,iBAAiB,MAAM,EACvB,oBAAoB,MAAM,EAC1B,iBAAc;;;;;qBAeO,WAAW,EAAE;;;;;;qBAAb,WAAW,EAAE;;;;;;CA0QnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,SACpB,CAAC;AAChC,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,SACpB,CAAC;AAClC,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SACf,CAAC;AAEtC,eAAO,MAAM,kBAAkB,GAC7B,aAAa,WAAW,EAAE,EAC1B,SAAS,WAAW,EACpB,WAAW,MAAM,GAAG,MAAM,KACzB,WAAW,GAAG,SAkBhB,CAAC"}
|
|
@@ -7,7 +7,7 @@ import emitter, { emit } from "../../utils/events";
|
|
|
7
7
|
import isEmpty from "lodash/isEmpty";
|
|
8
8
|
import { useChatContext } from "../../context/ChatContext";
|
|
9
9
|
import useAuthStore from "../../store/auth";
|
|
10
|
-
import { ConnectStatus } from "../../types/chat";
|
|
10
|
+
import { ConnectStatus, SyncStatus } from "../../types/chat";
|
|
11
11
|
export const visibleTypeMessage = [
|
|
12
12
|
MessageType.TextMessage,
|
|
13
13
|
MessageType.PictureMessage,
|
|
@@ -26,10 +26,11 @@ export const visibleTypeMessage = [
|
|
|
26
26
|
MessageType.LogTextMessage,
|
|
27
27
|
];
|
|
28
28
|
export const useMessage = (conversationId, searchClientMsgID, enabled = true) => {
|
|
29
|
-
const { connectStatus } = useChatContext();
|
|
29
|
+
const { connectStatus, syncStatus } = useChatContext();
|
|
30
30
|
const userID = useAuthStore((state) => state.userID);
|
|
31
31
|
const canLoad = enabled &&
|
|
32
32
|
connectStatus === ConnectStatus.Connected &&
|
|
33
|
+
syncStatus !== SyncStatus.Loading &&
|
|
33
34
|
!!conversationId &&
|
|
34
35
|
!!userID;
|
|
35
36
|
const [loadState, setLoadState] = useState({
|
|
@@ -151,7 +152,6 @@ export const useMessage = (conversationId, searchClientMsgID, enabled = true) =>
|
|
|
151
152
|
});
|
|
152
153
|
setTimeout(() => {
|
|
153
154
|
emit("CHAT_LIST_SCROLL_TO_MESSAGE", searchClientMsgID);
|
|
154
|
-
console.log("emit scroll to message");
|
|
155
155
|
}, 200);
|
|
156
156
|
}, {
|
|
157
157
|
manual: true,
|