about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop/MRUStorageWrapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Desktop/MRUStorageWrapper.cs')
-rw-r--r--MatrixRoomUtils.Desktop/MRUStorageWrapper.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/MatrixRoomUtils.Desktop/MRUStorageWrapper.cs b/MatrixRoomUtils.Desktop/MRUStorageWrapper.cs
index 27403dc..a5494ad 100644
--- a/MatrixRoomUtils.Desktop/MRUStorageWrapper.cs
+++ b/MatrixRoomUtils.Desktop/MRUStorageWrapper.cs
@@ -54,6 +54,8 @@ public class MRUStorageWrapper {
 
         tokens.Add(loginResponse);
         await _storageService.DataStorageProvider.SaveObjectAsync("mru.tokens", tokens);
+        if(await GetCurrentToken() is null)
+            await SetCurrentToken(loginResponse);
     }
 
     private async Task<AuthenticatedHomeServer?> GetCurrentSession() {
@@ -85,7 +87,7 @@ public class MRUStorageWrapper {
         if (session is null) {
             // _navigationManager.NavigateTo("/Login");
             var wnd = new LoginWindow(this);
-            wnd.Show();
+            wnd.ShowDialog(MainWindow.Instance);
             while (wnd.IsVisible) await Task.Delay(100);
             session = await GetCurrentSession();
         }