comparison src/heartbeat.js.luan @ 111:37ab261aee7b default tip

notify fix
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 16 Sep 2025 00:01:53 -0600
parents 62d6725b4db0
children
comparison
equal deleted inserted replaced
110:d2637760cd00 111:37ab261aee7b
18 local Online = require "site:/lib/Online.luan" 18 local Online = require "site:/lib/Online.luan"
19 local set_online = Online.set or error() 19 local set_online = Online.set or error()
20 local get_online = Online.get or error() 20 local get_online = Online.get or error()
21 local Chat = require "site:/lib/Chat.luan" 21 local Chat = require "site:/lib/Chat.luan"
22 local get_chat_by_id = Chat.get_by_id or error() 22 local get_chat_by_id = Chat.get_by_id or error()
23 local Notify = require "site:/lib/Notify.luan"
24 local notify_active = Notify.active or error()
23 local Logging = require "luan:logging/Logging.luan" 25 local Logging = require "luan:logging/Logging.luan"
24 local logger = Logging.logger "heartbeat.js" 26 local logger = Logging.logger "heartbeat.js"
25 27
26 28
27 return function() 29 return function()
45 location = '/'; 47 location = '/';
46 <% 48 <%
47 return 49 return
48 end 50 end
49 51
52 local focus = Http.request.parameters.focus or error()
53 if focus == "true" then
54 notify_active(user)
55 end
56
50 local online = get_online(user) 57 local online = get_online(user)
51 %> 58 %>
52 online = <%=json_string(online,compressed)%>; 59 online = <%=json_string(online,compressed)%>;
53 showOnline(); 60 showOnline();
54 <% 61 <%