fix: terminate timer tasks when ran

This commit is contained in:
Arnaud Vergnet 2020-12-07 14:06:04 +01:00
parent 8d45d4c7e2
commit f5848e1ab3
3 changed files with 3 additions and 0 deletions

View file

@ -59,6 +59,7 @@ public class ChatHistory {
@Override @Override
public void run() { public void run() {
Platform.runLater(() -> notifyHistoryLoaded()); Platform.runLater(() -> notifyHistoryLoaded());
t.cancel();
} }
}, 1000); }, 1000);
} }

View file

@ -86,6 +86,7 @@ public class MainController implements Initializable {
@Override @Override
public void run() { public void run() {
Platform.runLater(() -> CurrentUser.getInstance().setState(CurrentUser.State.VALID)); Platform.runLater(() -> CurrentUser.getInstance().setState(CurrentUser.State.VALID));
t.cancel();
} }
}, 3000); }, 3000);

View file

@ -54,6 +54,7 @@ public class EditUsernameDialogController implements Initializable {
public void run() { public void run() {
// onError(); // onError();
onSuccess(); onSuccess();
t.cancel();
} }
}, 1000); }, 1000);
} }