Fix TypingDetection
This commit is contained in:
@@ -17,8 +17,14 @@ public partial class MareHub
|
||||
_logger.LogCallInfo(MareHubLogger.Args(isTyping));
|
||||
|
||||
var pairedEntries = await GetAllPairedClientsWithPauseState().ConfigureAwait(false);
|
||||
if (pairedEntries.Count == 0)
|
||||
return;
|
||||
|
||||
var sender = await DbContext.Users.AsNoTracking()
|
||||
.SingleAsync(u => u.UID == UserUID)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var typingDto = new TypingStateDto(sender.ToUserData(), isTyping);
|
||||
|
||||
await Clients.Caller.Client_UserTypingState(typingDto).ConfigureAwait(false);
|
||||
|
||||
var recipients = pairedEntries
|
||||
.Where(p => !p.IsPaused)
|
||||
@@ -29,12 +35,6 @@ public partial class MareHub
|
||||
if (recipients.Count == 0)
|
||||
return;
|
||||
|
||||
var sender = await DbContext.Users.AsNoTracking()
|
||||
.SingleAsync(u => u.UID == UserUID)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var typingDto = new TypingStateDto(sender.ToUserData(), isTyping);
|
||||
|
||||
await Clients.Users(recipients).Client_UserTypingState(typingDto).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class SystemInfoService : IHostedService, IDisposable
|
||||
SystemInfoDto = new SystemInfoDto()
|
||||
{
|
||||
OnlineUsers = onlineUsers,
|
||||
SupportsTypingState = true,
|
||||
};
|
||||
|
||||
if (_config.IsMain)
|
||||
@@ -95,4 +96,4 @@ public class SystemInfoService : IHostedService, IDisposable
|
||||
{
|
||||
_timer?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user