From 734844291c16facd4a7d4341d355937c4ea4e1bf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 20 Aug 2022 14:38:46 +0200 Subject: [PATCH] fix bug I introduced --- files/helpers/const.py | 4 +++- files/helpers/jinja2.py | 2 +- files/routes/chat.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index a8857a6f4..89443e83e 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1014,4 +1014,6 @@ has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html') has_logo = path.exists(f'files/assets/images/{SITE_NAME}/logo.webp') has_app = path.exists(f'files/assets/app_{SITE_NAME}_v2.4.apk') -GLOBAL = environ.get("GLOBAL") \ No newline at end of file +GLOBAL = environ.get("GLOBAL") + +ONLINE_STR = f'{SITE}_online' \ No newline at end of file diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 391b198a4..d146c4e64 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -58,4 +58,4 @@ def inject_constants(): "LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK, "DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, "has_sidebar": has_sidebar, "has_logo": has_logo, "has_app": has_app, - "FP": FP, "NOTIF_MODACTION_JL_MIN": NOTIF_MODACTION_JL_MIN, "cache": cache, "ONLINE_STR": f'{SITE}_online', "patron": patron} + "FP": FP, "NOTIF_MODACTION_JL_MIN": NOTIF_MODACTION_JL_MIN, "cache": cache, "ONLINE_STR": ONLINE_STR, "patron": patron} diff --git a/files/routes/chat.py b/files/routes/chat.py index 4672214f0..81150505d 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -18,6 +18,7 @@ else: typing = [] online = [] +cache.set(ONLINE_STR, len(online)) muted = cache.get(f'{SITE}_muted') or {} messages = cache.get(f'{SITE}_chat') or [] total = cache.get(f'{SITE}_total') or 0