diff --git a/Wino.Mail.ViewModels/ImapCalDavSettingsPageViewModel.cs b/Wino.Mail.ViewModels/ImapCalDavSettingsPageViewModel.cs
index b6b5d9d5..64a9c646 100644
--- a/Wino.Mail.ViewModels/ImapCalDavSettingsPageViewModel.cs
+++ b/Wino.Mail.ViewModels/ImapCalDavSettingsPageViewModel.cs
@@ -16,7 +16,6 @@ using Wino.Core.Domain.Models.Navigation;
using Wino.Core.Domain.Models.Synchronization;
using Wino.Core.Services;
using Wino.Mail.ViewModels.Data;
-using Wino.Messaging.Client.Calendar;
using Wino.Messaging.Client.Navigation;
using Wino.Messaging.Server;
@@ -319,7 +318,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
try
{
var minimalSettings = BuildMinimalSettingsOrThrow();
- await AutoDiscoverAndApplySettingsAsync(minimalSettings).ConfigureAwait(false);
+ await AutoDiscoverAndApplySettingsAsync(minimalSettings);
_mailDialogService.InfoBarMessage(
Translator.IMAPSetupDialog_ValidationSuccess_Title,
@@ -399,7 +398,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
{
try
{
- await EnsureImapSettingsPreparedAsync().ConfigureAwait(false);
+ await EnsureImapSettingsPreparedAsync();
var serverInformation = BuildServerInformation();
@@ -407,12 +406,12 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
ValidateImapSettings(serverInformation);
ValidateCalendarModeSpecificSettings(serverInformation);
- await ValidateImapConnectivityAsync(serverInformation).ConfigureAwait(false);
+ await ValidateImapConnectivityAsync(serverInformation);
IsImapValidationSucceeded = true;
if (serverInformation.CalendarSupportMode == ImapCalendarSupportMode.CalDav)
{
- await ValidateCalDavConnectivityAsync(serverInformation).ConfigureAwait(false);
+ await ValidateCalDavConnectivityAsync(serverInformation);
IsCalDavValidationSucceeded = true;
}
else
@@ -432,7 +431,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
return;
}
- await SaveEditFlowAsync(serverInformation).ConfigureAwait(false);
+ await SaveEditFlowAsync(serverInformation);
}
catch (Exception ex)
{
@@ -654,7 +653,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
return;
var minimalSettings = BuildMinimalSettingsOrThrow();
- await AutoDiscoverAndApplySettingsAsync(minimalSettings).ConfigureAwait(false);
+ await AutoDiscoverAndApplySettingsAsync(minimalSettings);
if (!HasCompleteImapSettings())
throw new InvalidOperationException(Translator.Exception_ImapAutoDiscoveryFailed);
@@ -676,22 +675,25 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
if (serverInformation == null)
throw new InvalidOperationException(Translator.Exception_ImapAutoDiscoveryFailed);
- ApplyServerInformation(serverInformation);
-
- if (IsCalendarSupportEnabled && SelectedCalendarSupportMode == ImapCalendarSupportMode.CalDav)
+ await ExecuteUIThread(async () =>
{
- var discoveredCalDavUri = await _autoDiscoveryService.DiscoverCalDavServiceUriAsync(minimalSettings.Email).ConfigureAwait(false);
- if (discoveredCalDavUri != null)
+ ApplyServerInformation(serverInformation);
+
+ if (IsCalendarSupportEnabled && SelectedCalendarSupportMode == ImapCalendarSupportMode.CalDav)
{
- CalDavServiceUrl = discoveredCalDavUri.ToString();
+ var discoveredCalDavUri = await _autoDiscoveryService.DiscoverCalDavServiceUriAsync(minimalSettings.Email);
+ if (discoveredCalDavUri != null)
+ {
+ CalDavServiceUrl = discoveredCalDavUri.ToString();
+ }
+
+ if (string.IsNullOrWhiteSpace(CalDavUsername))
+ CalDavUsername = minimalSettings.Email;
+
+ if (string.IsNullOrWhiteSpace(CalDavPassword))
+ CalDavPassword = minimalSettings.Password;
}
-
- if (string.IsNullOrWhiteSpace(CalDavUsername))
- CalDavUsername = minimalSettings.Email;
-
- if (string.IsNullOrWhiteSpace(CalDavPassword))
- CalDavPassword = minimalSettings.Password;
- }
+ });
}
private async Task ValidateImapConnectivityAsync(CustomServerInformation serverInformation)
{
diff --git a/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml b/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml
index 0f982859..9f45c2a3 100644
--- a/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml
+++ b/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml
@@ -4,267 +4,267 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:abstract="using:Wino.Views.Abstract"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:helpers="using:Wino.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ HorizontalAlignment="Center">
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ Text="{x:Bind ViewModel.BasicSectionTitleText, Mode=OneWay}" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml.cs b/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml.cs
index baa63e43..2ff450c0 100644
--- a/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml.cs
+++ b/Wino.Mail.WinUI/Views/Account/ImapCalDavSettingsPage.xaml.cs
@@ -1,5 +1,3 @@
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
using Wino.Views.Abstract;
namespace Wino.Views;
@@ -10,22 +8,4 @@ public sealed partial class ImapCalDavSettingsPage : ImapCalDavSettingsPageAbstr
{
InitializeComponent();
}
-
- private void OnSetupModeSelectionChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs e)
- {
- ViewModel.SelectedSetupTabIndex = SetupModeSelector.SelectedItem == null ? 0 : SetupModeSelector.Items.IndexOf(SetupModeSelector.SelectedItem);
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
-
- var tabIndex = ViewModel.SelectedSetupTabIndex;
- if (tabIndex < 0 || tabIndex >= SetupModeSelector.Items.Count)
- {
- tabIndex = 0;
- }
-
- SetupModeSelector.SelectedItem = SetupModeSelector.Items[tabIndex];
- }
}
diff --git a/Wino.Services/AccountService.cs b/Wino.Services/AccountService.cs
index 2dd3a33d..ccb47aff 100644
--- a/Wino.Services/AccountService.cs
+++ b/Wino.Services/AccountService.cs
@@ -475,7 +475,7 @@ public class AccountService : BaseDatabaseService, IAccountService
public async Task UpdateAccountCustomServerInformationAsync(CustomServerInformation customServerInformation)
{
- await Connection.UpdateAsync(customServerInformation, typeof(CustomServerInformation)).ConfigureAwait(false);
+ await Connection.InsertOrReplaceAsync(customServerInformation, typeof(CustomServerInformation)).ConfigureAwait(false);
}
public async Task UpdateAccountAliasesAsync(Guid accountId, List aliases)