diff --git a/client/shared/redux/hooks/useConverseMessage.ts b/client/shared/redux/hooks/useConverseMessage.ts index dbe687b3..27355a7f 100644 --- a/client/shared/redux/hooks/useConverseMessage.ts +++ b/client/shared/redux/hooks/useConverseMessage.ts @@ -67,13 +67,9 @@ function useHandleSendMessage() { sendMessage(payload) .then((message) => { dispatch( - chatActions.updateMessageInfo({ + chatActions.deleteMessageById({ + converseId: payload.converseId, messageId: localMessageId, - message: { - ...message, - isLocal: false, - sendFailed: false, - }, }) ); diff --git a/client/shared/redux/setup.ts b/client/shared/redux/setup.ts index 9cb0f794..4d2ebbe2 100644 --- a/client/shared/redux/setup.ts +++ b/client/shared/redux/setup.ts @@ -166,16 +166,9 @@ function listenNotify(socket: AppSocket, store: AppStore) { // 处理接受到的消息 const converseId = message.converseId; const converse = store.getState().chat.converses[converseId]; - const userId = store.getState().user.info?._id; // 添加消息到会话中 const appendMessage = () => { - if (message.author === userId) { - // 如果是自己发送的消息,则忽略 - // 因为存在local状态的消息,应该由发送消息的地方处理 - return; - } - store.dispatch( chatActions.appendConverseMessage({ converseId, diff --git a/client/web/plugins/com.msgbyte.bbcode/src/index.tsx b/client/web/plugins/com.msgbyte.bbcode/src/index.tsx index fa021a3f..ab9e1bdc 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/index.tsx +++ b/client/web/plugins/com.msgbyte.bbcode/src/index.tsx @@ -12,6 +12,7 @@ import('./render'); const BBCode = Loadable(() => import('./render'), { componentName: `${PLUGIN_ID}:renderComponent`, + fallback: null, }); let serialize: (bbcode: string) => string; import('./bbcode/serialize').then((module) => {