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

Commit cdb8f6a

Browse files
committed
Improve log in tracking.
1 parent 74f352b commit cdb8f6a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Quarrel.ViewModels/Services/Discord/DiscordService.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public partial class DiscordService : IDiscordService
2525
private readonly ILocalizationService _localizationService;
2626
private readonly IDispatcherService _dispatcherService;
2727
private readonly IMessenger _messenger;
28+
private LoginType? _loginSource;
2829

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

6768
try
6869
{
70+
_loginSource = source;
6971
await _quarrelClient.LoginAsync(token);
7072

71-
_analyticsService.Log(LoggedEvent.SuccessfulLogin,
72-
(nameof(source), $"{source}"));
73-
7473
return true;
7574
}
7675
catch (Exception e)
@@ -87,6 +86,8 @@ public async Task<bool> LoginAsync(string token, LoginType source = LoginType.Un
8786

8887
private void OnLoggedIn(object sender, SelfUser e)
8988
{
89+
_analyticsService.Log(LoggedEvent.SuccessfulLogin, (nameof(_loginSource), $"{_loginSource}"));
90+
9091
string? token = _quarrelClient.Token;
9192

9293
Guard.IsNotNull(token, nameof(token));

0 commit comments

Comments
 (0)