fix: restore current contest and problem
This commit is contained in:
parent
d12d9cb3f0
commit
c73c5ce4c8
@ -138,9 +138,19 @@ object SDom {
|
|||||||
val result = client.get("${SDCredentials.url}contests/${currentContest!!.id}/problems")
|
val result = client.get("${SDCredentials.url}contests/${currentContest!!.id}/problems")
|
||||||
if (result.status.isSuccess()) {
|
if (result.status.isSuccess()) {
|
||||||
problems = result.body<List<Problem>>()
|
problems = result.body<List<Problem>>()
|
||||||
|
|
||||||
|
if (!problems.contains(currentProblem)) {
|
||||||
|
currentProblem = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val loggedIn: Boolean
|
val loggedIn: Boolean
|
||||||
get() = SDCredentials.credentials.first != null && SDCredentials.credentials.second != null
|
get() = SDCredentials.credentials.first != null && SDCredentials.credentials.second != null
|
||||||
|
|
||||||
|
init {
|
||||||
|
if (loggedIn) {
|
||||||
|
loginListeners.forEach { ApplicationManager.getApplication().invokeLater(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user