|
|
|
@ -40,7 +40,18 @@ const InputComposer = ({ mobile }) => {
|
|
|
|
|
const talkabled = !isEmpty(currentConversation.sn) && websocketOpened;
|
|
|
|
|
const isExpired = !isEmpty(currentConversation.conversation_expiretime) ? dayjs(currentConversation.conversation_expiretime).add(8, 'hours').isBefore(dayjs()) : true;
|
|
|
|
|
const gt24h = !isEmpty(currentConversation.last_received_time) ? dayjs().diff(dayjs(currentConversation.last_received_time), 'hour') > 24 : true;
|
|
|
|
|
const textabled = talkabled && (!(gt24h && isExpired)); // 只要有一个时间没过期, 目前未知明确规则
|
|
|
|
|
const lt24h = !isEmpty(currentConversation.last_received_time) ? dayjs().diff(dayjs(currentConversation.last_received_time), 'hour') <= 24 : false;
|
|
|
|
|
// lt24h || !isExpired
|
|
|
|
|
const textabled = talkabled && (lt24h || !isExpired); // 只要有一个时间没过期, 目前未知明确规则
|
|
|
|
|
// debug: 日志
|
|
|
|
|
console.group('InputComposer textabled');
|
|
|
|
|
console.log('c_sn, websocketOpened, lt24h, isExpired, textabled', currentConversation.sn, websocketOpened, lt24h, isExpired, textabled);
|
|
|
|
|
console.log('received time, expire time', currentConversation.last_received_time, ', ', currentConversation.conversation_expiretime);
|
|
|
|
|
if (!isEmpty(currentConversation.sn) && !textabled) {
|
|
|
|
|
console.log('current chat: ---- \n', JSON.stringify(currentConversation, null, 2));
|
|
|
|
|
// window.$pageSpy.triggerPlugins('onOfflineLog', 'upload');
|
|
|
|
|
}
|
|
|
|
|
console.groupEnd();
|
|
|
|
|
const textPlaceHolder = !textabled
|
|
|
|
|
? ''
|
|
|
|
|
: mobile === undefined
|
|
|
|
|