Skip to content

Commit

Permalink
fix password prompt
Browse files Browse the repository at this point in the history
fix invalid password behavior
  • Loading branch information
MELVARDEV committed Feb 7, 2022
1 parent 77b5e89 commit 8c33f46
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions LeagueAccManager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,6 @@ private void unlockButton_Click(object sender, RoutedEventArgs e)
datagrid1.ItemsSource = null;
datagrid1.ItemsSource = lolAccounts;
datagrid1.Items.Refresh();
this.ResizeMode = ResizeMode.CanResize;

passwordPromptGrid.Visibility = Visibility.Hidden;
Application.Current.MainWindow.Height = 500;
Application.Current.MainWindow.Width = 846;
Helpers.CenterWindowOnScreen(this);
tabControl.Visibility = Visibility.Visible;
}

bool readValSuccess = await readValorantAccounts();
Expand All @@ -521,18 +514,19 @@ private void unlockButton_Click(object sender, RoutedEventArgs e)
dataGridValorant.ItemsSource = null;
dataGridValorant.ItemsSource = valorantAccounts;
dataGridValorant.Items.Refresh();
this.ResizeMode = ResizeMode.CanResize;

passwordPromptGrid.Visibility = Visibility.Hidden;
Application.Current.MainWindow.Height = 500;
Application.Current.MainWindow.Width = 846;
Helpers.CenterWindowOnScreen(this);
tabControl.Visibility = Visibility.Visible;
}

if (!readValSuccess && !readLolSuccess)
if (!readValSuccess || !readLolSuccess)
{
MessageBox.Show("Wrong encryption key!");
} else
{
this.ResizeMode = ResizeMode.CanResize;
passwordPromptGrid.Visibility = Visibility.Hidden;
Application.Current.MainWindow.Height = 500;
Application.Current.MainWindow.Width = 846;
tabControl.Visibility = Visibility.Visible;
Helpers.CenterWindowOnScreen(this);
}
});
});
Expand Down

0 comments on commit 8c33f46

Please sign in to comment.