Skip to content

Commit

Permalink
Заебешь
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Oct 12, 2024
1 parent 0a9ba2d commit b4ef479
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Content.Client/_Sunrise/UserProfile/UserProfile.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public sealed partial class UserProfile : Control
private readonly IClientServiceAuthManager? _serviceAuthManager;
private readonly ISharedSponsorsManager? _sponsorsManager;

private string _donateUrl = string.Empty;

public UserProfile()
{
IoCManager.InjectDependencies(this);
Expand All @@ -27,7 +29,7 @@ public UserProfile()
IoCManager.Instance!.TryResolveType(out _sponsorsManager);
IoCManager.Instance!.TryResolveType(out _serviceAuthManager);

BuySponsorButton.Disabled = _cfg.GetCVar(SunriseCCVars.InfoLinksDonate) == "";
_cfg.OnValueChanged(SunriseCCVars.InfoLinksDonate, OnInfoLinksDonateChanged, true);

if (_serviceAuthManager == null || _sponsorsManager == null)
return;
Expand All @@ -41,6 +43,12 @@ public UserProfile()
_sponsorsManager.LoadedSponsorData += RefreshSponsorData;
}

private void OnInfoLinksDonateChanged(string url)
{
BuySponsorButton.Disabled = url == "";
_donateUrl = url;
}

private void RefreshSponsorData()
{
if (_sponsorsManager == null)
Expand Down Expand Up @@ -83,7 +91,7 @@ private void RefreshServiceLinkedServices(List<LinkedServiceData> linkedServices

private void BuySponsorPressed(BaseButton.ButtonEventArgs obj)
{
_uri.OpenUri(_cfg.GetCVar(SunriseCCVars.InfoLinksDonate));
_uri.OpenUri(_donateUrl);
}

private void LinkTelegramPressed(BaseButton.ButtonEventArgs obj)
Expand Down

0 comments on commit b4ef479

Please sign in to comment.