Выравнивание аватарок и онлайн-индикатора iOS с desktop (Mantine v8)

This commit is contained in:
2026-03-08 17:10:02 +05:00
parent 196765f038
commit 8e27542c5b
17 changed files with 331 additions and 76 deletions

View File

@@ -328,14 +328,15 @@ final class ProtocolManager: @unchecked Sendable {
private func startHeartbeat(interval: Int) {
heartbeatTask?.cancel()
let intervalMs = UInt64(interval) * 1_000_000_000 / 3
// Desktop parity: heartbeat at half the server-specified interval.
let intervalNs = UInt64(interval) * 1_000_000_000 / 2
heartbeatTask = Task {
// Send first heartbeat immediately
client.sendText("heartbeat")
while !Task.isCancelled {
try? await Task.sleep(nanoseconds: intervalMs)
try? await Task.sleep(nanoseconds: intervalNs)
guard !Task.isCancelled else { break }
client.sendText("heartbeat")
}