don't read multiple times etc
parent
80466f3150
commit
65236df78a
|
@ -45,11 +45,11 @@ def calc_users(v):
|
||||||
g.loggedout_counter = len(loggedout)
|
g.loggedout_counter = len(loggedout)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def calc_chat_users():
|
def calc_chat_users(v:Optional[User]):
|
||||||
if g.is_api_or_xhr:
|
if v and g.is_api_or_xhr:
|
||||||
g.loggedin_chat = 0
|
g.loggedin_chat = 0
|
||||||
else:
|
elif not hasattr(g, 'loggedin_chat'):
|
||||||
g.loggedin_chat = cache.get(CHAT_ONLINE_CACHE_KEY, 0)
|
g.loggedin_chat = cache.get(CHAT_ONLINE_CACHE_KEY) or 0
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def get_logged_in_user():
|
def get_logged_in_user():
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{calc_chat_users()}}
|
{{calc_chat_users(v)}}
|
||||||
<div class="container d-inline-flex d-lg-none">
|
<div class="container d-inline-flex d-lg-none">
|
||||||
<div class="row fixed-bottom bg-white border-top p-2" id="mobile-bottom-navigation-bar"
|
<div class="row fixed-bottom bg-white border-top p-2" id="mobile-bottom-navigation-bar"
|
||||||
style="z-index: 1000; bottom: 0px; transition: bottom cubic-bezier(0, 0, 0.2, 1) 220ms;">
|
style="z-index: 1000; bottom: 0px; transition: bottom cubic-bezier(0, 0, 0.2, 1) 220ms;">
|
||||||
|
|
Loading…
Reference in New Issue