scrollDown() wartet jetzt auf document.fonts.ready und scrollt erneut. chat-page.js wartet nach loadHistory() zusätzlich per requestAnimationFrame auf den Repaint nach Font-Swap.
17 lines
594 B
C#
17 lines
594 B
C#
using System.Collections.Concurrent;
|
|
|
|
namespace Gott.Services;
|
|
|
|
public class StreamingTracker
|
|
{
|
|
private readonly ConcurrentDictionary<string, string> _streaming = new ConcurrentDictionary<string, string>();
|
|
|
|
public void Start(string sessionId, string chainId) => _streaming[sessionId] = chainId;
|
|
|
|
public void Stop(string sessionId) => _streaming.TryRemove(sessionId, out _);
|
|
|
|
public bool IsStreaming(string sessionId) => _streaming.ContainsKey(sessionId);
|
|
|
|
public string GetChainId(string sessionId) => _streaming.TryGetValue(sessionId, out var chainId) ? chainId : null;
|
|
}
|