修复 部分 toast 没有正确显示

This commit is contained in:
Aigio Liu
2021-05-11 15:04:48 +08:00
parent 565185378f
commit bd9632f4f6
3 changed files with 7 additions and 7 deletions
@@ -7,9 +7,9 @@
xmlns:ms="clr-namespace:System.Application.Models.Settings;assembly=System.Application.SteamTools.Client.Desktop"
FontFamily="{ReflectionBinding Source={x:Static ms:UISettings.FontName},Path=Value, Mode=OneWay,Converter={StaticResource NameToFontFamilyConverter}}"
mc:Ignorable="d"
d:DesignWidth="800" d:DesignHeight="600"
Width="800" Height="600"
MinWidth="600" MinHeight="600"
d:DesignWidth="800" d:DesignHeight="500"
Width="800" Height="500"
MinWidth="500" MinHeight="500"
Background="{x:Null}"
x:Class="System.Application.UI.Views.Windows.WebView3Window"
x:DataType="vm:WebView3WindowViewModel"
@@ -256,9 +256,9 @@ namespace System.Application.UI.Views.Windows
}
}
protected override void OnInitialized()
protected override void OnOpened(EventArgs e)
{
base.OnInitialized();
base.OnOpened(e);
if (loginUsingSteamClientState == LoginUsingSteamClientState.Loading)
{
Toast.Show(AppResources.GetLoginUsingSteamClientCookies);
@@ -105,9 +105,9 @@ namespace System.Application.UI.ViewModels
static async Task SuccessAsync(LoginOrRegisterResponse rsp, Action? close)
{
await UserService.Current.RefreshUserAsync();
close?.Invoke();
var msg = AppResources.Success_.Format((rsp?.IsLoginOrRegister ?? false) ? AppResources.User_Login : AppResources.User_Register);
Toast.Show(msg);
close?.Invoke();
}
public void ChangeLoginState(short state)
@@ -158,9 +158,9 @@ namespace System.Application.UI.ViewModels
{
MainThreadDesktop.BeginInvokeOnMainThread(() =>
{
conn_helper.ShowResponseErrorMessage(response);
close?.Invoke();
vm?.Close?.Invoke();
conn_helper.ShowResponseErrorMessage(response);
});
}
}