迁移聊天室本地清屏入口
This commit is contained in:
@@ -3608,19 +3608,18 @@
|
||||
// ── 本地清屏(仅限自己的屏幕)───────────────────────────
|
||||
|
||||
function localClearScreen() {
|
||||
// 清理公聊窗口
|
||||
const say1 = document.getElementById('chat-messages-container');
|
||||
if (say1) say1.innerHTML = '';
|
||||
|
||||
// 清理包厢窗口
|
||||
const say2 = document.getElementById('chat-messages-container2');
|
||||
if (say2) say2.innerHTML = '';
|
||||
lastAutosaveNode = null;
|
||||
if (window.ChatRoomTools?.localClearScreen) {
|
||||
window.ChatRoomTools.localClearScreen(window.chatContext.roomId, _maxMsgId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 将当前最大消息 ID 保存至本地,刷新时只显示大于此 ID 的历史记录
|
||||
const say1 = document.getElementById('chat-messages-container');
|
||||
const say2 = document.getElementById('chat-messages-container2');
|
||||
if (say1) say1.innerHTML = '';
|
||||
if (say2) say2.innerHTML = '';
|
||||
localStorage.setItem(`local_clear_msg_id_${window.chatContext.roomId}`, _maxMsgId);
|
||||
|
||||
// 插入清屏提示
|
||||
const sysDiv = document.createElement('div');
|
||||
sysDiv.className = 'msg-line';
|
||||
const now = new Date();
|
||||
@@ -3638,6 +3637,11 @@
|
||||
* 在状态面板中触发本地清屏,并顺手关闭面板。
|
||||
*/
|
||||
function handleFeatureLocalClear() {
|
||||
if (window.ChatRoomTools?.handleFeatureLocalClear) {
|
||||
window.ChatRoomTools.handleFeatureLocalClear(localClearScreen);
|
||||
return;
|
||||
}
|
||||
|
||||
closeFeatureMenu();
|
||||
localClearScreen();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user