diff --git a/src/views/Conversations/Online/InputComposer.jsx b/src/views/Conversations/Online/InputComposer.jsx index c17332d..0400a11 100644 --- a/src/views/Conversations/Online/InputComposer.jsx +++ b/src/views/Conversations/Online/InputComposer.jsx @@ -43,6 +43,7 @@ const InputComposer = ({ mobile }) => { const lt24h = !isEmpty(currentConversation.last_received_time) ? dayjs().diff(dayjs(currentConversation.last_received_time), 'hour') <= 24 : false; // lt24h || !isExpired const textabled = talkabled; // && (lt24h || !isExpired); // 只要有一个时间没过期, 目前未知明确规则 + const textabled0 = talkabled && (lt24h || !isExpired); // 只要有一个时间没过期, 目前未知明确规则 // debug: 日志 console.group('InputComposer textabled'); console.log('c_sn, websocketOpened, lt24h, isExpired, textabled', currentConversation.sn, websocketOpened, lt24h, isExpired, textabled); @@ -268,8 +269,10 @@ const InputComposer = ({ mobile }) => { maxLength={complexMsg.id ? 1024 : 2000} showCount={textabled} placeholder={ - !textabled + !talkabled ? '请先选择会话' + : !textabled0 + ? '会话已超24h不活跃. 请发送打招呼消息激活对话💬.' : mobile === undefined ? 'Enter 发送, Shift+Enter 换行\n支持复制粘贴 [截图/文件] 以备发送' : 'Enter 换行, 点击 Send 发送' diff --git a/src/views/Conversations/Online/MessagesWrapper.jsx b/src/views/Conversations/Online/MessagesWrapper.jsx index 6aedf16..2821d6d 100644 --- a/src/views/Conversations/Online/MessagesWrapper.jsx +++ b/src/views/Conversations/Online/MessagesWrapper.jsx @@ -12,8 +12,8 @@ import { useVisibilityState } from '@/hooks/useVisibilityState'; const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => { const userId = useAuthStore((state) => state.loginUser.userId); - const [currentConversation, updateCurrentConversation, setCurrentConversation] = useConversationStore(useShallow((state) => [state.currentConversation, state.updateCurrentConversation, state.setCurrentConversation])); - const conversationsList = useConversationStore(useShallow((state) => state.conversationsList)); + const [currentConversation, updateCurrentConversation, setCurrentConversation] = useConversationStore((state) => [state.currentConversation, state.updateCurrentConversation, state.setCurrentConversation]); + const conversationsList = useConversationStore((state) => state.conversationsList); const activeMessages = useConversationStore(useShallow((state) => (state.currentConversation.sn && state.activeConversations[state.currentConversation.sn] ? state.activeConversations[state.currentConversation.sn]: []))); const addToConversationList = useConversationStore((state) => state.addToConversationList);