修复自动钓鱼状态与播报屏蔽范围

This commit is contained in:
pllx
2026-04-29 16:51:28 +08:00
parent 449894e3e5
commit 6748fbc44e
3 changed files with 48 additions and 31 deletions
+14 -13
View File
@@ -673,27 +673,28 @@ export function syncBlockedSystemSenderCheckboxes() {
*/
export function setRenderedMessagesVisibilityBySender(blockKey, hidden) {
const state = window.chatState;
[state?.container, state?.container2].forEach(targetContainer => {
if (!targetContainer) return;
const targetContainer = state?.container;
if (targetContainer) {
targetContainer.querySelectorAll("[data-block-key]").forEach(node => {
if (node.dataset.blockKey === blockKey) {
if (hidden) {
node.dataset.blockHidden = "1";
node.style.display = "none";
} else if (node.dataset.blockHidden === "1") {
node.removeAttribute("data-block-hidden");
node.style.display = "";
}
if (node.dataset.blockKey !== blockKey) {
return;
}
// 屏蔽项只清理公屏已有播报,包厢窗口保留用户自己的钓鱼过程和结果提示。
if (hidden) {
node.dataset.blockHidden = "1";
node.style.display = "none";
} else if (node.dataset.blockHidden === "1") {
node.removeAttribute("data-block-hidden");
node.style.display = "";
}
});
});
}
if (!hidden && state?.autoScroll) {
const container = state.container;
const container2 = state.container2;
if (container) container.scrollTop = container.scrollHeight;
if (container2) container2.scrollTop = container2.scrollHeight;
}
}