宝宝来信角标改实心红圆;停在首页每 60 秒刷新未读数 (v26100446)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 02:26:51 +00:00
parent 3caee8e94b
commit 19525a6f68
3 changed files with 10 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100445';
var VER = '26100446';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -5250,6 +5250,10 @@
document.addEventListener('visibilitychange', function () {
if (!document.hidden) syncLaixinReminder();
});
/* 2026-10-05 用户:「来信里有信了就该提醒,不用等我点进来信页」→ 停在首页时也每 60 秒拉一次未读数,
信按时间慢慢送达时,tab 圈数字会自己冒出来(页面在后台 / 不在前台时不拉,省流量)。
⚠️ 前提是上游 unread 到点就算数;如果上游要等打开来信页才投递,这里拉多少次也是 0(已找「宝宝来信(新)」会话确认)。 */
setInterval(function () { if (!document.hidden) syncLaixinReminder(); }, 60000);
/* 从来信页「返回」时浏览器可能直接从往返缓存(bfcache)恢复本页,不一定触发 visibilitychange → 补一个 pageshow */
addEventListener('pageshow', function (e) { if (e.persisted) syncLaixinReminder(); });