From df17d84cb532d41cb492e7cc5f461cc7813b771e Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Fri, 17 Oct 2025 21:48:51 +0800 Subject: [PATCH] Update index.js --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 1e84289..e0bfc30 100644 --- a/index.js +++ b/index.js @@ -488,6 +488,11 @@ jQuery(async () => { eventSource.on(event_types.IMPERSONATE_READY, onMessageReceived); eventSource.on(event_types.MESSAGE_RECEIVED, (chat_id) => handleTableUpdate(chat_id)); eventSource.on(event_types.MESSAGE_SWIPED, (chat_id) => { + const context = getContext(); + if (context.chat.length < 2) { + log(`【监察系统】检测到消息滑动,但聊天记录不足2条,已跳过状态回退。`, 'info'); + return; + } log(`【监察系统】检测到消息滑动 (SWIPED),开始执行状态回退...`, 'warn'); rollbackState(); });