Skip to content

Commit

Permalink
CheckPledgeStatus only if the user is connected to patreon
Browse files Browse the repository at this point in the history
  • Loading branch information
C1rdec committed Dec 5, 2024
1 parent 72843c2 commit 622f159
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/PoeLurker.Core/KeyboardLurker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public KeyboardLurker(int processId, SettingsService settingsService, HotkeyServ
_keyboardHelper = keyboardHelper;

_itemParser = new ItemParser();
_itemParser.CheckPledgeStatus();
if (settingsService.ConnectedToPatreon)
{
_itemParser.CheckPledgeStatus();
}

_settingsService.OnSave += SettingsService_OnSave;
_keyboardHook = new KeyboardHook(_processId);
_ = _keyboardHook.InstallAsync();
Expand Down
2 changes: 1 addition & 1 deletion src/PoeLurker.UI/PoeLurker.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<ApplicationIcon>TrayIcon.ico</ApplicationIcon>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<AssemblyName>PoeLurker</AssemblyName>
</PropertyGroup>

Expand Down
5 changes: 4 additions & 1 deletion src/PoeLurker.UI/ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,10 @@ public Task HandleAsync(SkillTimelineMessage message, CancellationToken token)
/// </summary>
private async Task CheckPledgeStatus()
{
await ClipboardHelper.CheckPledgeStatusAsync();
if (_settingsService.ConnectedToPatreon)
{
await ClipboardHelper.CheckPledgeStatusAsync();
}
}

private Task ShowViewModel(PoeOverlayBase overlay)
Expand Down
9 changes: 6 additions & 3 deletions src/PoeLurker.UI/ViewModels/SplashScreenViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ public SplashscreenViewModel(SettingsViewModel settings, IEventAggregator eventA

Execute.OnUIThread(async () =>
{
await patreonService.CheckPledgeStatus();
if (patreonService.Pledging)
if (!settings.NotConnected)
{
return;
await patreonService.CheckPledgeStatus();
if (patreonService.Pledging)
{
return;
}
}

ShowPatreon = true;
Expand Down
7 changes: 5 additions & 2 deletions src/PoeLurker.UI/ViewModels/TradebarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,11 @@ protected override Task OnDeactivateAsync(bool close, CancellationToken token)
/// </summary>
protected async override Task OnActivateAsync(CancellationToken token)
{
await _pushBulletService.CheckPledgeStatus();
await _pushHoverService.CheckPledgeStatus();
if (SettingsService.ConnectedToPatreon)
{
await _pushBulletService.CheckPledgeStatus();
await _pushHoverService.CheckPledgeStatus();
}

SettingsService.OnSave += SettingsService_OnSave;

Expand Down

0 comments on commit 622f159

Please sign in to comment.