1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 17:53:32 +00:00

Remove Flurl

This commit is contained in:
Diogo Trindade 2023-11-05 18:15:37 +00:00
parent c67d2ab6fe
commit afa4c508b3
No known key found for this signature in database
GPG Key ID: 00AD95E8D2C30E85
3 changed files with 5 additions and 8 deletions

View File

@ -24,7 +24,6 @@
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Skia.Lottie" Version="11.0.0" /> <PackageReference Include="Avalonia.Skia.Lottie" Version="11.0.0" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.1" /> <PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.1" />
<PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.2" /> <PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.2" />
<PackageReference Include="Octopus.Octodiff" Version="2.0.468" /> <PackageReference Include="Octopus.Octodiff" Version="2.0.468" />
<PackageReference Include="PropertyChanged.SourceGenerator" Version="1.0.8"> <PackageReference Include="PropertyChanged.SourceGenerator" Version="1.0.8">

View File

@ -101,7 +101,7 @@
</Ellipse.Fill> </Ellipse.Fill>
</Ellipse> </Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0"> <TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
Diogo 'DrMeteor' Trindade Diogo Trindade
</TextBlock> </TextBlock>
<TextBlock Classes="subtitle" Grid.Column="1" Grid.Row="1" Padding="0"> <TextBlock Classes="subtitle" Grid.Column="1" Grid.Row="1" Padding="0">
Main contributor Main contributor
@ -176,7 +176,6 @@
<TextBlock Classes="library-name">DryIoc</TextBlock> <TextBlock Classes="library-name">DryIoc</TextBlock>
<TextBlock Classes="library-name">FluentAvalonia</TextBlock> <TextBlock Classes="library-name">FluentAvalonia</TextBlock>
<TextBlock Classes="library-name">EmbedIO</TextBlock> <TextBlock Classes="library-name">EmbedIO</TextBlock>
<TextBlock Classes="library-name">Furl.Http</TextBlock>
<TextBlock Classes="library-name">Humanizer</TextBlock> <TextBlock Classes="library-name">Humanizer</TextBlock>
<TextBlock Classes="library-name">LiteDB</TextBlock> <TextBlock Classes="library-name">LiteDB</TextBlock>
<TextBlock Classes="library-name">McMaster.NETCore.Plugins</TextBlock> <TextBlock Classes="library-name">McMaster.NETCore.Plugins</TextBlock>
@ -199,9 +198,6 @@
<controls:HyperlinkButton NavigateUri="https://unosquare.github.io/embedio/"> <controls:HyperlinkButton NavigateUri="https://unosquare.github.io/embedio/">
https://unosquare.github.io/embedio/ https://unosquare.github.io/embedio/
</controls:HyperlinkButton> </controls:HyperlinkButton>
<controls:HyperlinkButton NavigateUri="https://flurl.dev/">
https://flurl.dev/
</controls:HyperlinkButton>
<controls:HyperlinkButton NavigateUri="https://github.com/Humanizr/Humanizer"> <controls:HyperlinkButton NavigateUri="https://github.com/Humanizr/Humanizer">
https://github.com/Humanizr/Humanizer https://github.com/Humanizr/Humanizer
</controls:HyperlinkButton> </controls:HyperlinkButton>

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Net.Http;
using System.Reactive; using System.Reactive;
using System.Reactive.Disposables; using System.Reactive.Disposables;
using System.Threading; using System.Threading;
@ -10,7 +11,6 @@ using Artemis.WebClient.Workshop;
using Artemis.WebClient.Workshop.Services; using Artemis.WebClient.Workshop.Services;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Controls;
using Flurl.Http;
using PropertyChanged.SourceGenerator; using PropertyChanged.SourceGenerator;
using ReactiveUI; using ReactiveUI;
using Serilog; using Serilog;
@ -21,6 +21,7 @@ public partial class CurrentUserViewModel : ActivatableViewModelBase
{ {
private readonly IAuthenticationService _authenticationService; private readonly IAuthenticationService _authenticationService;
private readonly ObservableAsPropertyHelper<bool> _isAnonymous; private readonly ObservableAsPropertyHelper<bool> _isAnonymous;
private readonly HttpClient _httpClient;
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IWindowService _windowService; private readonly IWindowService _windowService;
[Notify] private bool _allowLogout = true; [Notify] private bool _allowLogout = true;
@ -35,6 +36,7 @@ public partial class CurrentUserViewModel : ActivatableViewModelBase
_logger = logger; _logger = logger;
_authenticationService = authenticationService; _authenticationService = authenticationService;
_windowService = windowService; _windowService = windowService;
_httpClient = new HttpClient();
Login = ReactiveCommand.CreateFromTask(ExecuteLogin); Login = ReactiveCommand.CreateFromTask(ExecuteLogin);
_isAnonymous = this.WhenAnyValue(vm => vm.Loading, vm => vm.Name, (l, n) => l || n == null).ToProperty(this, vm => vm.IsAnonymous); _isAnonymous = this.WhenAnyValue(vm => vm.Loading, vm => vm.Name, (l, n) => l || n == null).ToProperty(this, vm => vm.IsAnonymous);
@ -106,7 +108,7 @@ public partial class CurrentUserViewModel : ActivatableViewModelBase
try try
{ {
Avatar?.Dispose(); Avatar?.Dispose();
Avatar = new Bitmap(await $"{WorkshopConstants.AUTHORITY_URL}/user/avatar/{userId}".GetStreamAsync()); Avatar = new Bitmap(await _httpClient.GetStreamAsync($"{WorkshopConstants.AUTHORITY_URL}/user/avatar/{userId}"));
} }
catch (Exception) catch (Exception)
{ {