会话过期提示

hotfix/new-conversation
Lei OT 1 year ago
parent 6be3d9c05e
commit 25b2be45bd

@ -43,6 +43,7 @@ const InputComposer = ({ mobile }) => {
const lt24h = !isEmpty(currentConversation.last_received_time) ? dayjs().diff(dayjs(currentConversation.last_received_time), 'hour') <= 24 : false; const lt24h = !isEmpty(currentConversation.last_received_time) ? dayjs().diff(dayjs(currentConversation.last_received_time), 'hour') <= 24 : false;
// lt24h || !isExpired // lt24h || !isExpired
const textabled = talkabled; // && (lt24h || !isExpired); // , const textabled = talkabled; // && (lt24h || !isExpired); // ,
const textabled0 = talkabled && (lt24h || !isExpired); // ,
// debug: // debug:
console.group('InputComposer textabled'); console.group('InputComposer textabled');
console.log('c_sn, websocketOpened, lt24h, isExpired, textabled', currentConversation.sn, websocketOpened, lt24h, isExpired, 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} maxLength={complexMsg.id ? 1024 : 2000}
showCount={textabled} showCount={textabled}
placeholder={ placeholder={
!textabled !talkabled
? '请先选择会话' ? '请先选择会话'
: !textabled0
? '会话已超24h不活跃. 请发送打招呼消息激活对话💬.'
: mobile === undefined : mobile === undefined
? 'Enter 发送, Shift+Enter 换行\n支持复制粘贴 [截图/文件] 以备发送' ? 'Enter 发送, Shift+Enter 换行\n支持复制粘贴 [截图/文件] 以备发送'
: 'Enter 换行, 点击 Send 发送' : 'Enter 换行, 点击 Send 发送'

@ -12,8 +12,8 @@ import { useVisibilityState } from '@/hooks/useVisibilityState';
const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => { const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
const userId = useAuthStore((state) => state.loginUser.userId); const userId = useAuthStore((state) => state.loginUser.userId);
const [currentConversation, updateCurrentConversation, setCurrentConversation] = useConversationStore(useShallow((state) => [state.currentConversation, state.updateCurrentConversation, state.setCurrentConversation])); const [currentConversation, updateCurrentConversation, setCurrentConversation] = useConversationStore((state) => [state.currentConversation, state.updateCurrentConversation, state.setCurrentConversation]);
const conversationsList = useConversationStore(useShallow((state) => state.conversationsList)); 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 activeMessages = useConversationStore(useShallow((state) => (state.currentConversation.sn && state.activeConversations[state.currentConversation.sn] ? state.activeConversations[state.currentConversation.sn]: [])));
const addToConversationList = useConversationStore((state) => state.addToConversationList); const addToConversationList = useConversationStore((state) => state.addToConversationList);

Loading…
Cancel
Save