X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.kt;h=853fe26d136058c689175897fccdf412151377e1;hp=9872d1e79e1d855b69fc4dd346d786dae74b51a8;hb=fecc40a37c481ea7c8d0aa5d13331834d165de6a;hpb=51b58fad3a00b2d9cae45345ac066e89233ba0b5 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt index 9872d1e..853fe26 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt @@ -30,7 +30,7 @@ class GetStatusAjaxPage(webInterface: WebInterface, private val elementLoader: E } override fun createJsonObject(request: FreenetRequest) = - (webInterface.getCurrentSoneWithoutCreatingSession(request.toadletContext) as Sone?).let { currentSone -> + webInterface.getCurrentSoneWithoutCreatingSession(request.toadletContext).let { currentSone -> createSuccessJsonObject().apply { this["loggedIn"] = currentSone != null this["options"] = currentSone?.options?.toJsonOptions() ?: jsonObject {}