profilepanel: Don't remove the login box when the password is incorrect (#1393)

This commit is contained in:
Owain van Brakel
2019-08-19 02:31:10 +02:00
committed by Kyle
parent 45fd48d01d
commit f3916c8cb2

View File

@@ -156,20 +156,27 @@ class ProfilesPanel extends PluginPanel
@Override @Override
public void mousePressed(MouseEvent e) public void mousePressed(MouseEvent e)
{ {
boolean error = false;
try try
{ {
remove(loginPanel);
add(accountPanel, BorderLayout.CENTER);
profilesPanel.setLayout(new DynamicGridLayout(0, 1, 0, 3));
add(profilesPanel, BorderLayout.SOUTH);
redrawProfiles(); redrawProfiles();
} }
catch (InvalidKeySpecException | NoSuchAlgorithmException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchPaddingException ex) catch (InvalidKeySpecException | NoSuchAlgorithmException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchPaddingException ex)
{ {
error = true;
showErrorMessage("Unable to load data", "Incorrect password!"); showErrorMessage("Unable to load data", "Incorrect password!");
} }
if (error)
{
return;
}
remove(loginPanel);
add(accountPanel, BorderLayout.CENTER);
profilesPanel.setLayout(new DynamicGridLayout(0, 1, 0, 3));
add(profilesPanel, BorderLayout.SOUTH);
} }
@Override @Override