diff --git a/Wino.Core.Domain/Interfaces/IAccountService.cs b/Wino.Core.Domain/Interfaces/IAccountService.cs
index 63aba714..6c590df7 100644
--- a/Wino.Core.Domain/Interfaces/IAccountService.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountService.cs
@@ -170,4 +170,5 @@ public interface IAccountService
/// Account id.
/// Whether the notifications should be created after sync or not.
Task IsNotificationsEnabled(Guid accountId);
+ Task UpdateAccountCustomServerInformationAsync(CustomServerInformation customServerInformation);
}
diff --git a/Wino.Core.Domain/Translations/en_US/resources.json b/Wino.Core.Domain/Translations/en_US/resources.json
index 3fc21dca..227a28f9 100644
--- a/Wino.Core.Domain/Translations/en_US/resources.json
+++ b/Wino.Core.Domain/Translations/en_US/resources.json
@@ -262,6 +262,8 @@
"IMAPSetupDialog_AccountType": "Account type",
"IMAPSetupDialog_ValidationSuccess_Title": "Success",
"IMAPSetupDialog_ValidationSuccess_Message": "Validation successful",
+ "IMAPSetupDialog_SaveImapSuccess_Title": "Success",
+ "IMAPSetupDialog_SaveImapSuccess_Message": "IMAP settings saved successfuly.",
"IMAPSetupDialog_ValidationFailed_Title": "IMAP Server validation failed.",
"IMAPSetupDialog_CertificateAllowanceRequired_Row0": "This server is requesting a SSL handshake to continue. Please confirm the certificate details below.",
"IMAPSetupDialog_CertificateAllowanceRequired_Row1": "Allow the handshake to continue setting up your account.",
diff --git a/Wino.Mail.ViewModels/EditAccountDetailsPageViewModel.cs b/Wino.Mail.ViewModels/EditAccountDetailsPageViewModel.cs
index 0c2e19e2..9878d71e 100644
--- a/Wino.Mail.ViewModels/EditAccountDetailsPageViewModel.cs
+++ b/Wino.Mail.ViewModels/EditAccountDetailsPageViewModel.cs
@@ -98,19 +98,13 @@ public partial class EditAccountDetailsPageViewModel : MailBaseViewModel
Messenger.Send(new BackBreadcrumNavigationRequested());
}
- [RelayCommand]
- private Task SaveWithoutGoBackAsync()
- {
- return UpdateAccountAsync();
- }
-
[RelayCommand]
private async Task ValidateImapSettingsAsync()
{
try
{
await _imapTestService.TestImapConnectionAsync(ServerInformation, true);
- _mailDialogService.InfoBarMessage(Translator.IMAPSetupDialog_ValidationSuccess_Title, Translator.IMAPSetupDialog_ValidationSuccess_Message, Core.Domain.Enums.InfoBarMessageType.Success); ;
+ _mailDialogService.InfoBarMessage(Translator.IMAPSetupDialog_ValidationSuccess_Title, Translator.IMAPSetupDialog_ValidationSuccess_Message, Core.Domain.Enums.InfoBarMessageType.Success);
}
catch (Exception ex)
{
@@ -118,12 +112,9 @@ public partial class EditAccountDetailsPageViewModel : MailBaseViewModel
}
}
- private Task UpdateAccountAsync()
+ [RelayCommand]
+ private async Task UpdateCustomServerInformationAsync()
{
- Account.Name = AccountName;
- Account.SenderName = SenderName;
- Account.AccountColorHex = SelectedColor == null ? string.Empty : SelectedColor.Hex;
-
if (ServerInformation != null)
{
ServerInformation.IncomingAuthenticationMethod = AvailableAuthenticationMethods[SelectedIncomingServerAuthenticationMethodIndex].ImapAuthenticationMethod;
@@ -135,6 +126,17 @@ public partial class EditAccountDetailsPageViewModel : MailBaseViewModel
Account.ServerInformation = ServerInformation;
}
+ await _accountService.UpdateAccountCustomServerInformationAsync(Account.ServerInformation);
+
+ _mailDialogService.InfoBarMessage(Translator.IMAPSetupDialog_SaveImapSuccess_Title, Translator.IMAPSetupDialog_SaveImapSuccess_Message, Core.Domain.Enums.InfoBarMessageType.Success);
+ }
+
+ private Task UpdateAccountAsync()
+ {
+ Account.Name = AccountName;
+ Account.SenderName = SenderName;
+ Account.AccountColorHex = SelectedColor == null ? string.Empty : SelectedColor.Hex;
+
return _accountService.UpdateAccountAsync(Account);
}
diff --git a/Wino.Mail/Views/Settings/EditAccountDetailsPage.xaml b/Wino.Mail/Views/Settings/EditAccountDetailsPage.xaml
index 036e5b7e..85a10665 100644
--- a/Wino.Mail/Views/Settings/EditAccountDetailsPage.xaml
+++ b/Wino.Mail/Views/Settings/EditAccountDetailsPage.xaml
@@ -11,7 +11,7 @@
xmlns:helpers="using:Wino.Helpers"
xmlns:imapsetup="using:Wino.Views.ImapSetup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:picker="using:Microsoft.UI.Xaml.Controls"
+ xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
@@ -118,7 +118,7 @@
Header="{x:Bind domain:Translator.IMAPSetupDialog_IncomingMailServer}"
Text="{x:Bind ViewModel.ServerInformation.IncomingServer, Mode=TwoWay}" />
-
-
-
diff --git a/Wino.Services/AccountService.cs b/Wino.Services/AccountService.cs
index e2f9fcf7..3d852403 100644
--- a/Wino.Services/AccountService.cs
+++ b/Wino.Services/AccountService.cs
@@ -408,6 +408,11 @@ public class AccountService : BaseDatabaseService, IAccountService
ReportUIChange(new AccountUpdatedMessage(account));
}
+ public async Task UpdateAccountCustomServerInformationAsync(CustomServerInformation customServerInformation)
+ {
+ await Connection.UpdateAsync(customServerInformation).ConfigureAwait(false);
+ }
+
public async Task UpdateAccountAliasesAsync(Guid accountId, List aliases)
{
// Delete existing ones.