Skip to content

Commit

Permalink
fix: Logout bug if registry keys are set
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Jan 7, 2025
1 parent 0101a25 commit d7b1758
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Guard.WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public partial class MainWindow : FluentWindow
private IntPtr windowInteropHandle;
private readonly bool isAutostart;
private string currentPageName = "";
public bool SkipApplyRegistrySettings = false;

public MainWindow(bool autostart)
{
Expand Down Expand Up @@ -186,8 +187,8 @@ private void NavLockClicked(object sender, RoutedEventArgs e)

internal void Logout()
{
SkipApplyRegistrySettings = true;
Navigate(typeof(Welcome));
HideNavigation();
Auth.Logout();
TokenManager.ClearTokens();
FullContentFrame.Visibility = Visibility.Visible;
Expand Down
5 changes: 5 additions & 0 deletions Guard.WPF/Views/Pages/Start/Welcome.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public Welcome()

private void ApplyRegistrySettings()
{
if(mainWindow.SkipApplyRegistrySettings)
{
mainWindow.SkipApplyRegistrySettings = false;
return;
}
(bool hideSkip, bool hideWinHello, bool hidePassword) =
RegistrySettings.GetSetupHideOptions();

Expand Down

0 comments on commit d7b1758

Please sign in to comment.