about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop/LoginWindow.axaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Desktop/LoginWindow.axaml.cs')
-rw-r--r--MatrixRoomUtils.Desktop/LoginWindow.axaml.cs37
1 files changed, 0 insertions, 37 deletions
diff --git a/MatrixRoomUtils.Desktop/LoginWindow.axaml.cs b/MatrixRoomUtils.Desktop/LoginWindow.axaml.cs
deleted file mode 100644

index 183c46b..0000000 --- a/MatrixRoomUtils.Desktop/LoginWindow.axaml.cs +++ /dev/null
@@ -1,37 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Interactivity; -using Avalonia.Markup.Xaml; -using Avalonia.VisualTree; - -namespace MatrixRoomUtils.Desktop; - -public partial class LoginWindow : Window { - private readonly MRUStorageWrapper _storage; - - public LoginWindow(MRUStorageWrapper storage) { - _storage = storage; - InitializeComponent(); -#if DEBUG - this.AttachDevTools(); -#endif - } - - private void InitializeComponent() { - AvaloniaXamlLoader.Load(this); - } - - public string Username { get; set; } - public string Password { get; set; } - // ReSharper disable once AsyncVoidMethod - private async void Login(object? sender, RoutedEventArgs e) { - var res = await _storage.Login(Username.Split(':')[1], Username.Split(':')[0][1..], Password); - if (res is not null) { - await _storage.AddToken(res); - Close(); - } - else { - Password = ""; - } - } -}