Skip to content

Commit

Permalink
Merge pull request #20 from 1eeing/main
Browse files Browse the repository at this point in the history
update uikit v9.7.0
  • Loading branch information
shine2008 authored Jan 11, 2024
2 parents 3825165 + e6f794b commit 96c483a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@xkit-yx/call-kit": "^2.0.1",
"@xkit-yx/call-kit-react-ui": "^0.4.1",
"@xkit-yx/im-kit-ui": "^9.6.4",
"@xkit-yx/im-kit-ui": "^9.7.0",
"react-dom": "^16.8.0",
"umi": "^3.5.40"
},
Expand Down
9 changes: 5 additions & 4 deletions react/src/YXUIKit/im-kit-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xkit-yx/im-kit-ui",
"version": "9.6.4",
"version": "9.7.0",
"description": "云信即时通讯组件",
"license": "MIT",
"main": "lib/index.js",
Expand Down Expand Up @@ -56,12 +56,13 @@
},
"dependencies": {
"@ant-design/icons": "^5.0.1",
"@xkit-yx/core-kit": "^0.10.8",
"@xkit-yx/im-store": "^0.0.15",
"@xkit-yx/core-kit": "^0.11.0",
"@xkit-yx/im-store": "^0.1.0",
"@xkit-yx/utils": "^0.5.6",
"antd": "^4.16.3",
"mobx": "^6.6.1",
"mobx-react": "^7.5.2",
"react-string-replace": "^1.1.0"
}
},
"gitHead": "f3ce7aa9536c224fcdc0e4a1a26b333be1036442"
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const P2pChatContainer: React.FC<P2pChatContainerProps> = observer(
if (historyMsgs.length < storeConstants.HISTORY_LIMIT) {
setNoMore(true)
}
return historyMsgs
} catch (error) {
setLoadingMore(false)
message.error(t('getHistoryMsgFailedText'))
Expand Down Expand Up @@ -466,11 +467,21 @@ const P2pChatContainer: React.FC<P2pChatContainerProps> = observer(
!['beReCallMsg', 'reCallMsg'].includes(item.attach?.type || '')
).length < 10
) {
getHistory(Date.now()).then(() => {
getHistory(Date.now()).then((res) => {
scrollToBottom()
if (session && !session.lastMsg && res && res[0]) {
store.sessionStore.addSession([{ ...session, lastMsg: res[0] }])
}
})
}
}, [store.msgStore, sessionId, getHistory, scrollToBottom])
}, [
store.msgStore,
store.sessionStore,
session,
sessionId,
getHistory,
scrollToBottom,
])

// 处理消息
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ const TeamChatContainer: React.FC<TeamChatContainerProps> = observer(
if (historyMsgs.length < storeConstants.HISTORY_LIMIT) {
setNoMore(true)
}
return historyMsgs
} catch (error) {
setLoadingMore(false)
message.error(t('getHistoryMsgFailedText'))
Expand Down Expand Up @@ -835,11 +836,21 @@ const TeamChatContainer: React.FC<TeamChatContainerProps> = observer(
!['beReCallMsg', 'reCallMsg'].includes(item.attach?.type || '')
).length < 10
) {
getHistory(Date.now()).then(() => {
getHistory(Date.now()).then((res) => {
scrollToBottom()
if (session && !session.lastMsg && res && res[0]) {
store.sessionStore.addSession([{ ...session, lastMsg: res[0] }])
}
})
}
}, [store.msgStore, sessionId, getHistory, scrollToBottom])
}, [
store.msgStore,
store.sessionStore,
session,
sessionId,
getHistory,
scrollToBottom,
])

// 处理消息
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const ConversationItem: FC<ConversationItemProps> = ({
commonPrefix = 'common',
}) => {
const date = useMemo(() => {
if (!time) {
return ''
}
const _d = moment(time)
const isCurrentDay = _d.isSame(moment(), 'day')
const isCurrentYear = _d.isSame(moment(), 'year')
Expand Down
2 changes: 1 addition & 1 deletion vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"@xkit-yx/im-kit-ui": "^9.6.4",
"@xkit-yx/im-kit-ui": "^9.7.0",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"vue": "^3.2.45"
Expand Down

0 comments on commit 96c483a

Please sign in to comment.