mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed some problems that table dialogs were not closed if the table controller closed the table.
This commit is contained in:
parent
557f08d4bc
commit
cb8b4d8cbf
2 changed files with 6 additions and 3 deletions
|
@ -1321,7 +1321,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
break;
|
||||
case CLIENT_DISCONNECT:
|
||||
if (SessionHandler.isConnected()) {
|
||||
endTables();
|
||||
SessionHandler.disconnect(false);
|
||||
}
|
||||
tablesPane.clearChat();
|
||||
|
@ -1351,7 +1350,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
break;
|
||||
case CLIENT_EXIT:
|
||||
if (SessionHandler.isConnected()) {
|
||||
endTables();
|
||||
SessionHandler.disconnect(false);
|
||||
}
|
||||
CardRepository.instance.closeDB();
|
||||
|
|
|
@ -418,7 +418,12 @@ class UpdateSeatsTask extends SwingWorker<Void, TableView> {
|
|||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
while (!isCancelled()) {
|
||||
SessionHandler.getTable(roomId, tableId).ifPresent(this::publish);
|
||||
Optional<TableView> tableView = SessionHandler.getTable(roomId, tableId);
|
||||
if (tableView.isPresent()) {
|
||||
tableView.ifPresent(this::publish);
|
||||
} else {
|
||||
dialog.closeDialog();
|
||||
}
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue