Fixed entering offline mode
This commit is contained in:
parent
8714c8fe0e
commit
8c1cfedb2e
@ -101,8 +101,7 @@ public class LoginDialog extends JDialog {
|
||||
|
||||
// Listen to handshake rejections
|
||||
EventBus.getInstance().register(HandshakeRejectionEvent.class, evt -> {
|
||||
for (Component c : contentPanel.getComponents())
|
||||
if (c == errorMessage) contentPanel.remove(errorMessage);
|
||||
if (errorMessage != null) contentPanel.remove(errorMessage);
|
||||
clearPasswordFields();
|
||||
errorMessage = new JLabel(evt.get());
|
||||
gbc_errorMessage = new GridBagConstraints();
|
||||
@ -135,9 +134,7 @@ public class LoginDialog extends JDialog {
|
||||
client.initReceiver(localDb, receivedMessageCache);
|
||||
dispose();
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
} catch (TimeLimitExceededException e) {
|
||||
} catch (IOException | InterruptedException | TimeLimitExceededException e) {
|
||||
logger.warning("Could not connect to server. Trying offline mode...");
|
||||
e.printStackTrace();
|
||||
try {
|
||||
|
@ -101,7 +101,6 @@ public class Startup {
|
||||
// Set client user in local database
|
||||
localDb.setUser(client.getSender());
|
||||
|
||||
|
||||
// Initialize chats in local database
|
||||
try {
|
||||
localDb.initializeUserStorage();
|
||||
|
Reference in New Issue
Block a user