Fix current match killfeed visible limit and polling stability

This commit is contained in:
devRaGonSa
2026-06-16 19:50:57 +02:00
parent 01a217ca40
commit f1c52249ef
2 changed files with 23 additions and 5 deletions

View File

@@ -118,11 +118,8 @@ function configureOptionalLinks(nodes, serverSlug) {
async function loadKillFeed({ backendBaseUrl, serverSlug, nodes, killFeedState }) {
try {
const cursor = killFeedState.latestEventId
? `&since_event_id=${encodeURIComponent(killFeedState.latestEventId)}`
: "";
const payload = await fetchJson(
`${backendBaseUrl}/api/current-match/kills?server=${encodeURIComponent(serverSlug)}&limit=${CURRENT_MATCH_KILL_FEED_LIMIT}${cursor}`,
`${backendBaseUrl}/api/current-match/kills?server=${encodeURIComponent(serverSlug)}&limit=${CURRENT_MATCH_KILL_FEED_LIMIT}`,
);
renderKillFeed(payload?.data || {}, nodes, killFeedState);
} catch (error) {
@@ -225,7 +222,8 @@ function renderKillFeed(data, nodes, state) {
return;
}
const incoming = Array.isArray(data.items) ? data.items : [];
if (data.scope === "no-current-match-events") {
const hasVisibleEvents = state.byId.size > 0;
if (data.scope === "no-current-match-events" && !hasVisibleEvents) {
state.byId.clear();
state.latestEventId = "";
}