Handling of all day events and auto calendar sync on account creation.

This commit is contained in:
Burak Kaan Köse
2026-03-28 01:44:12 +01:00
parent 686446937b
commit 6f61605c12
16 changed files with 393 additions and 10381 deletions
+24 -4
View File
@@ -239,6 +239,13 @@ public partial class App : WinoApplication,
if (windowManager.GetWindow(WinoWindowKind.Shell) is not ShellWindow shellWindow)
return;
windowManager.HideWindow(shellWindow);
if (ReferenceEquals(MainWindow, shellWindow))
{
MainWindow = null;
InitializeNavigationDispatcher();
}
shellWindow.PrepareForClose();
shellWindow.Close();
}
@@ -748,7 +755,7 @@ public partial class App : WinoApplication,
/// Creates the main window without activating it.
/// Used for both normal launch and startup task launch (tray only).
/// </summary>
private void CreateWindow(Microsoft.UI.Xaml.LaunchActivatedEventArgs? args)
private void CreateWindow(Microsoft.UI.Xaml.LaunchActivatedEventArgs? args, string? forcedLaunchArguments = null)
{
LogActivation("Creating main window.");
@@ -761,6 +768,12 @@ public partial class App : WinoApplication,
windowManager.SetPrimaryNavigationFrame(WinoWindowKind.Shell, shellWindow.GetMainFrame());
if (!string.IsNullOrWhiteSpace(forcedLaunchArguments))
{
shellWindow.HandleAppActivation(forcedLaunchArguments);
return;
}
var activationArgs = AppInstance.GetCurrent().GetActivatedEventArgs();
if (activationArgs.Kind == ExtendedActivationKind.Launch &&
@@ -902,7 +915,6 @@ public partial class App : WinoApplication,
_hasConfiguredAccounts = true;
var windowManager = Services.GetRequiredService<IWinoWindowManager>();
var navigationService = Services.GetRequiredService<INavigationService>();
// Only transition when the account was created from the WelcomeWindow.
if (windowManager.GetWindow(WinoWindowKind.Welcome) == null)
@@ -911,12 +923,20 @@ public partial class App : WinoApplication,
MainWindow?.DispatcherQueue?.TryEnqueue(async () =>
{
// Create and activate ShellWindow — ActiveWindowChanged fires and rebinds the dispatcher.
CreateWindow(null);
CreateWindow(null, GetModeLaunchArgument(WinoApplicationMode.Mail));
CloseWelcomeWindowIfPresent();
navigationService.ChangeApplicationMode(Core.Domain.Enums.WinoApplicationMode.Mail);
if (MainWindow != null)
await ActivateWindowAsync(MainWindow);
if (message.Account.IsCalendarAccessGranted)
{
WeakReferenceMessenger.Default.Send(new NewCalendarSynchronizationRequested(new CalendarSynchronizationOptions
{
AccountId = message.Account.Id,
Type = CalendarSynchronizationType.CalendarEvents
}));
}
RestartAutoSynchronizationLoop();
});
}