Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,19 @@ private async Task InitializeServicesAsync(CancellationToken cancellationToken =
{
_logger.LogError($"Failed to refresh sync session state {ex.Message}", ex);
}

// If the user is not signed in, automatically show the sign-in window.
// This ensures new users see a clear next step instead of the app
// silently minimizing to the system tray.
var credentialModel = credentialManager.GetCachedCredentials();
if (credentialModel.State == CredentialState.Invalid)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if the app is signed out, is the logic to show the sign in window? am i reading correctly? if so, i wonder if that might be a bit much, as it will show the sign in window on every start of the computer which would be a pretty drastic UX change for those who don't use coder often, but install the update which this change ships with. I wonder if more of a "show once on first start of app, but not on subsequent starts" approach is more ideal?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rowansmithau Hmm, Yup, I have to take this into account. I will add some functionality around this and get back.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added code to handle this. Also, Tested it out and the pop up is no longer shown when the machine is restarted / shutdown and started up. It is only shown on first install. Any feedback is appreciated!

{
TrayWindow?.DispatcherQueue.TryEnqueue(() =>
{
var signInWindow = _services.GetRequiredService<SignInWindow>();
signInWindow.Activate();
});
}
}

public void OnActivated(object? sender, AppActivationArguments args)
Expand Down
Loading