v0.5.111: sort streamers by live status then follower count.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+21
-8
@@ -3957,6 +3957,9 @@ function streamerList() {
|
||||
const rows = streamersData().streamers;
|
||||
if (!Array.isArray(rows)) return [];
|
||||
return [...rows].sort((a, b) => {
|
||||
const la = a && a.is_live === true ? 1 : 0;
|
||||
const lb = b && b.is_live === true ? 1 : 0;
|
||||
if (la !== lb) return lb - la;
|
||||
const fa = Number(a.follower_count);
|
||||
const fb = Number(b.follower_count);
|
||||
const na = Number.isFinite(fa) && fa >= 0 ? fa : -1;
|
||||
@@ -4785,14 +4788,24 @@ function refreshStreamerLiveStatus() {
|
||||
}
|
||||
}
|
||||
if (!changed) return;
|
||||
// Update rendered cards in place (top-level page + hero detail panel);
|
||||
// rows already merged, so any later re-render picks up the new state.
|
||||
document
|
||||
.querySelectorAll(".streamer-card[data-streamer-id]")
|
||||
.forEach((card) => {
|
||||
const row = rows.find((r) => r && r.id === card.dataset.streamerId);
|
||||
if (row) syncStreamerCardLive(card, row);
|
||||
});
|
||||
// Re-render list views so live streamers bubble to the front; otherwise
|
||||
// sync any leftover cards in place (rows already merged for later paints).
|
||||
if (state.page === "streamers") {
|
||||
renderStreamers();
|
||||
} else if (
|
||||
state.page === "heroes" &&
|
||||
state.detailTab === "streamers" &&
|
||||
state.selectedKey
|
||||
) {
|
||||
renderDetail();
|
||||
} else {
|
||||
document
|
||||
.querySelectorAll(".streamer-card[data-streamer-id]")
|
||||
.forEach((card) => {
|
||||
const row = rows.find((r) => r && r.id === card.dataset.streamerId);
|
||||
if (row) syncStreamerCardLive(card, row);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
/* endpoint missing/unreachable: keep data.json is_live */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Local defaults; production export overwrites via export_relations_site.py. */
|
||||
var SITE_VERSION = "0.5.110";
|
||||
var SITE_VERSION = "0.5.111";
|
||||
var ABILITY_VIDEO_BASE = "";
|
||||
var STATIC_ASSET_BASE = "";
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>DOTA2 上分帝</title>
|
||||
<link rel="icon" href="/ui-icon/dota2_logo.png" type="image/png" />
|
||||
<link rel="stylesheet" href="/style.css?v=0.5.110" />
|
||||
<script src="/mobile-gate.js?v=0.5.110"></script>
|
||||
<link rel="stylesheet" href="/style.css?v=0.5.111" />
|
||||
<script src="/mobile-gate.js?v=0.5.111"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="sr-only">DOTA2 上分帝</h1>
|
||||
@@ -178,8 +178,8 @@
|
||||
|
||||
<section class="detail" id="detail" aria-live="polite"></section>
|
||||
|
||||
<script src="/config.js?v=0.5.110"></script>
|
||||
<script src="/router.js?v=0.5.110"></script>
|
||||
<script src="/app.js?v=0.5.110"></script>
|
||||
<script src="/config.js?v=0.5.111"></script>
|
||||
<script src="/router.js?v=0.5.111"></script>
|
||||
<script src="/app.js?v=0.5.111"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user