Show hidden bot count in visitors panel
This commit is contained in:
+4
-1
@@ -1100,11 +1100,14 @@ function conversationVisitorName(item) {
|
||||
function renderVisitors() {
|
||||
const visitors = state.hideBots ? state.visitors.filter((visitor) => !visitor.isBot) : state.visitors;
|
||||
const botCount = state.visitors.filter((visitor) => visitor.isBot).length;
|
||||
const humanCount = Math.max(0, state.visitors.length - botCount);
|
||||
const nextRenderKey = visitorListRenderKey(visitors, botCount);
|
||||
if (nextRenderKey === state.visitorRenderKey) return;
|
||||
state.visitorRenderKey = nextRenderKey;
|
||||
$("#hideBotsToggle").checked = state.hideBots;
|
||||
$("#visitorCount").textContent = `${visitors.length} na webu${state.hideBots && botCount ? ` · ${botCount} bot` : ""}`;
|
||||
$("#visitorCount").textContent = botCount
|
||||
? `${humanCount} lidi - ${botCount} botu`
|
||||
: `${visitors.length} na webu`;
|
||||
$("#visitorList").innerHTML = visitors.length ? visitors.map((visitor) => `
|
||||
<article class="visitor-card ${visitor.lastConversationId ? "clickable" : ""} ${visitor.lastConversationId === state.activeId ? "active" : ""} ${visitor.isBot ? "bot" : ""}" data-visitor-conversation="${escapeHtml(visitor.lastConversationId || "")}">
|
||||
<div class="visitor-card-head">
|
||||
|
||||
Reference in New Issue
Block a user