Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #613 from UWPCommunity/rewrite/main
Browse files Browse the repository at this point in the history
Release alpha
  • Loading branch information
matthew4850 authored May 24, 2022
2 parents d807e16 + cdb8f6a commit ad843a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/API/Discord.API/Gateways/Gateway.Sockets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task ResumeAsync()
private async Task ListenOnSocket()
{
var buffer = new ArraySegment<byte>(new byte[16 * 1024]);
while (_tokenSource.IsCancellationRequested && _socket!.State == WebSocketState.Open)
while (!_tokenSource.IsCancellationRequested && _socket!.State == WebSocketState.Open)
{
WebSocketReceiveResult socketResult = await _socket.ReceiveAsync(buffer, _tokenSource.Token).ConfigureAwait(false);
if (socketResult.MessageType == WebSocketMessageType.Close)
Expand Down
7 changes: 4 additions & 3 deletions src/Quarrel.ViewModels/Services/Discord/DiscordService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public partial class DiscordService : IDiscordService
private readonly ILocalizationService _localizationService;
private readonly IDispatcherService _dispatcherService;
private readonly IMessenger _messenger;
private LoginType? _loginSource;

/// <summary>
/// Initializes a new instance of the <see cref="DiscordService"/> class.
Expand Down Expand Up @@ -66,11 +67,9 @@ public async Task<bool> LoginAsync(string token, LoginType source = LoginType.Un

try
{
_loginSource = source;
await _quarrelClient.LoginAsync(token);

_analyticsService.Log(LoggedEvent.SuccessfulLogin,
(nameof(source), $"{source}"));

return true;
}
catch (Exception e)
Expand All @@ -87,6 +86,8 @@ public async Task<bool> LoginAsync(string token, LoginType source = LoginType.Un

private void OnLoggedIn(object sender, SelfUser e)
{
_analyticsService.Log(LoggedEvent.SuccessfulLogin, (nameof(_loginSource), $"{_loginSource}"));

string? token = _quarrelClient.Token;

Guard.IsNotNull(token, nameof(token));
Expand Down

0 comments on commit ad843a4

Please sign in to comment.