This commit is contained in:
retoor 2025-05-23 07:00:28 +02:00
parent 3bf09f9083
commit 539fb262b2
2 changed files with 14 additions and 6 deletions
src/snek

View File

@ -42,8 +42,9 @@ class MessageList extends HTMLElement {
textElement.innerHTML = html;
textElement.style.display = message.text == "" ? "none" : "block";
}
triggerGlow(uid) {
let lastElement = null;
triggerGlow(uid,color) {
app.startField.glowColor(color)
let lastElement = null;
this.querySelectorAll(".avatar").forEach((el) => {
const div = el.closest("a");
if (el.href.indexOf(uid) != -1) {

View File

@ -28,6 +28,7 @@ class RPCView(BaseView):
self.services = self.app.services
self.ws = ws
self.user_session = {}
self._scheduled = []
async def _session_ensure(self):
uid = await self.view.session_get("uid")
@ -339,9 +340,11 @@ class RPCView(BaseView):
async for record in self.services.channel.get_users(channel_uid)
]
async def _schedule(self, uid, seconds, call):
async def _schedule(self, seconds, call):
self._scheduled.append(call)
await asyncio.sleep(seconds)
await self.services.socket.send_to_user(uid, call)
await self.services.socket.send_to_user(self.user_uid, call)
self._scheduled.remove(call)
async def ping(self, callId, *args):
@ -353,11 +356,15 @@ class RPCView(BaseView):
async def get(self):
scheduled = []
async def schedule(uid, seconds, call):
scheduled.append(call)
await asyncio.sleep(seconds)
await self.services.socket.send_to_user(uid, call)
sheduled.remove(call)
ws = web.WebSocketResponse()
await ws.prepare(self.request)
@ -371,7 +378,7 @@ class RPCView(BaseView):
await self.services.socket.subscribe(
ws, subscription["channel_uid"], self.request.session.get("uid")
)
if self.request.app.uptime_seconds < 10:
if not scheduled and self.request.app.uptime_seconds < 10:
await schedule(self.request.session.get("uid"),1,{"event":"refresh", "data": {
"message": "Finishing deployment"}
}