diff --git a/src/main/kotlin/io/gitlab/jfronny/sdom/SDom.kt b/src/main/kotlin/io/gitlab/jfronny/sdom/SDom.kt index f9d394f..8eee410 100644 --- a/src/main/kotlin/io/gitlab/jfronny/sdom/SDom.kt +++ b/src/main/kotlin/io/gitlab/jfronny/sdom/SDom.kt @@ -138,9 +138,19 @@ object SDom { val result = client.get("${SDCredentials.url}contests/${currentContest!!.id}/problems") if (result.status.isSuccess()) { problems = result.body>() + + if (!problems.contains(currentProblem)) { + currentProblem = null + } } } val loggedIn: Boolean get() = SDCredentials.credentials.first != null && SDCredentials.credentials.second != null + + init { + if (loggedIn) { + loginListeners.forEach { ApplicationManager.getApplication().invokeLater(it) } + } + } } \ No newline at end of file