From 240b02c94e7745a7812eda62a0cc5f680f4ac7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Kaan=20K=C3=B6se?= Date: Wed, 26 Feb 2025 19:04:38 +0100 Subject: [PATCH] Fix gmail mail service not enabled error. --- Wino.Mail.ViewModels/AccountManagementViewModel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Wino.Mail.ViewModels/AccountManagementViewModel.cs b/Wino.Mail.ViewModels/AccountManagementViewModel.cs index 70366646..c3ccc7e1 100644 --- a/Wino.Mail.ViewModels/AccountManagementViewModel.cs +++ b/Wino.Mail.ViewModels/AccountManagementViewModel.cs @@ -115,6 +115,7 @@ public partial class AccountManagementViewModel : AccountManagementPageViewModel }; await creationDialog.ShowDialogAsync(accountCreationCancellationTokenSource); + await Task.Delay(500); creationDialog.State = AccountCreationDialogState.SigningIn; @@ -240,7 +241,7 @@ public partial class AccountManagementViewModel : AccountManagementPageViewModel var folderSynchronizationResult = folderSynchronizationResponse.Data; if (folderSynchronizationResult == null || folderSynchronizationResult.CompletedState != SynchronizationCompletedState.Success) - throw new Exception(Translator.Exception_FailedToSynchronizeFolders); + throw new Exception($"{Translator.Exception_FailedToSynchronizeFolders}\n{folderSynchronizationResponse.Message}"); // Sync aliases if supported. if (createdAccount.IsAliasSyncSupported) @@ -274,7 +275,7 @@ public partial class AccountManagementViewModel : AccountManagementPageViewModel DialogService.InfoBarMessage(Translator.Info_AccountCreatedTitle, string.Format(Translator.Info_AccountCreatedMessage, createdAccount.Address), InfoBarMessageType.Success); } } - catch (GmailServiceDisabledException) + catch (Exception ex) when (ex.Message.Contains(nameof(GmailServiceDisabledException))) { // For Google Workspace accounts, Gmail API might be disabled by the admin. // Wino can't continue synchronization in this case.