perf: 主动收件的提示

dev/emitter
Lei OT 10 months ago
parent b8497f155c
commit 5ecea03566

@ -354,7 +354,7 @@ const emailMsgMapped = {
},
'email.action.received': {
getMsg: (result) => {
return isEmpty(result?.emailMessage) ? null : { ...result.emailMessage, };
return isEmpty(result?.emailMessage) ? null : { ...result.emailMessage, id: result.id };
},
contentToRender: (contentObj) => null,
contentToUpdate: (msgcontent) => null,
@ -362,6 +362,7 @@ const emailMsgMapped = {
return {
...contentObj,
status: contentObj?.status || 'failed',
key: contentObj.email || contentObj.from || '',
content: `${contentObj.email || contentObj.from || '未知邮箱'} ${contentObj?.error?.message || ''}`,
title: (contentObj.status === 'failed') ? `接收邮件失败` : '',
type: (contentObj.status === 'failed') ? 'warning' : 'info',
@ -742,6 +743,8 @@ export const parseRenderMessageList = (messages) => {
dateString: msgStatusRenderMapped[msgContent?.status || 'failed'] === 'failed' ? `${(msg.msgtime || '').replace('T', ' ')} 发送失败 ${waError}` : '',
statusCN: msgStatusRenderMappedCN[msgContent?.status || 'failed'],
statusTitle: msgStatusRenderMappedCN[msgContent?.status || 'failed'],
id: (msgContent?.status || 'failed') === 'failed' ? msgContent.actionId : msg.id,
actionId: msgContent.actionId,
}
: {}),
...(isEmpty(messageorigin) && (isEmpty(msgContent.context) || msgContent.context?.forwarded === true)

@ -59,7 +59,7 @@ const initialConversationState = {
const globalNotifySlice = (set) => ({
globalNotify: [],
setGlobalNotify: (notify) => set(() => ({ globalNotify: notify })),
addGlobalNotify: (notify) => set((state) => ({ globalNotify: [...state.globalNotify, notify] })),
addGlobalNotify: (notify) => set((state) => ({ globalNotify: [notify, ...state.globalNotify] })),
removeGlobalNotify: (id) => set((state) => ({ globalNotify: state.globalNotify.filter(item => item.id !== id) })),
clearGlobalNotify: () => set(() => ({ globalNotify: [] })),
})

@ -18,10 +18,10 @@ const EmailFetch = ({ ...props }) => {
}
// message.info(globalNotify[0].content, 3)
notification.open({
key: globalNotify[0].id,
key: globalNotify[0].key,
message: globalNotify[0].title,
description: globalNotify[0].content,
duration: 0,
duration: 5,
placement: 'top',
type: globalNotify[0].type,
onClick: () => {

Loading…
Cancel
Save