Merge pull request #338 from SalvadorSTM/master

Add LOSE annotation to analytics page
This commit is contained in:
Roman Davydov
2023-10-05 20:16:02 +03:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -380,7 +380,7 @@ class WebSocketsPool:
counter=-1,
)
if event_prediction.result["type"] != "LOSE":
if event_prediction.result["type"]:
# Analytics switch
if Settings.enable_analytics is True:
ws.streamers[

View File

@@ -207,11 +207,11 @@ class Streamer(object):
# === ANALYTICS === #
def persistent_annotations(self, event_type, event_text):
event_type = event_type.upper()
if event_type in ["WATCH_STREAK", "WIN", "PREDICTION_MADE"]:
if event_type in ["WATCH_STREAK", "WIN", "PREDICTION_MADE", "LOSE"]:
primary_color = (
"#45c1ff"
"#45c1ff" #blue #45c1ff yellow #ffe045 green #36b535 red #ff4545
if event_type == "WATCH_STREAK"
else ("#ffe045" if event_type == "PREDICTION_MADE" else "#54ff45")
else ("#ffe045" if event_type == "PREDICTION_MADE" else ("#36b535" if event_type == "WIN" else "#ff4545"))
)
data = {
"borderColor": primary_color,