From fea1fe66ae62f6300aaa843467469ea8f6c883ca Mon Sep 17 00:00:00 2001 From: rmbgame Date: Sun, 9 May 2021 22:46:40 +0800 Subject: [PATCH] fix --- .../Services/Mvvm/SteamConnectService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs b/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs index ab25f00a0..45a8189dd 100644 --- a/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs +++ b/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs @@ -63,9 +63,9 @@ namespace System.Application.Services } } - static readonly CircleImageStream DefaultAvaterPath = new CircleImageStream("avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/avater.jpg"); - CircleImageStream? _AvaterPath = DefaultAvaterPath; - public CircleImageStream? AvaterPath + const string DefaultAvaterPath = "avares://System.Application.SteamTools.Client.Desktop.Avalonia/Application/UI/Assets/AppResources/avater.jpg"; + object? _AvaterPath = DefaultAvaterPath; + public object? AvaterPath { get => _AvaterPath; set => this.RaiseAndSetIfChanged(ref _AvaterPath, value); @@ -160,7 +160,9 @@ namespace System.Application.Services IsConnectToSteam = true; CurrentSteamUser = await SteamworksWebApiService.GetUserInfo(id); CurrentSteamUser.AvatarStream = IHttpService.Instance.GetImageAsync(CurrentSteamUser.AvatarFull, ImageChannelType.SteamAvatars); - AvaterPath = new CircleImageStream(await CurrentSteamUser.AvatarStream); + var avater = await CurrentSteamUser.AvatarStream; + if (avater != null) + AvaterPath = new CircleImageStream(avater); CurrentSteamUser.IPCountry = ApiService.GetIPCountry(); IsSteamChinaLauncher = ApiService.IsSteamChinaLauncher();