File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
desktopApp/src/main/kotlin/dev/dimension/flare/ui/screen/serviceselect Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import androidx.compose.runtime.LaunchedEffect
66import androidx.compose.ui.Modifier
77import io.github.kdroidfilter.webview.web.WebView
88import io.github.kdroidfilter.webview.web.rememberWebViewState
9+ import io.github.kdroidfilter.webview.wry.WryWebViewPanel
910import io.ktor.http.Url
1011import kotlinx.coroutines.delay
1112import kotlin.time.Duration.Companion.seconds
@@ -18,7 +19,7 @@ internal fun WebViewLoginScreen(
1819) {
1920 val state = rememberWebViewState(url)
2021 LaunchedEffect (Unit ) {
21- state.cookieManager.removeAllCookies ()
22+ ( state.webView?.nativeWebView as ? WryWebViewPanel )?.clearAllCookies ()
2223 val urlData = Url (url)
2324 val actualUrl =
2425 urlData.protocol.name
@@ -27,7 +28,10 @@ internal fun WebViewLoginScreen(
2728 .plus(" /" )
2829 while (true ) {
2930 delay(2 .seconds)
30- val cookies = state.nativeWebView.getCookiesForUrl(actualUrl)
31+ val cookies =
32+ (state.webView?.nativeWebView as ? WryWebViewPanel )
33+ ?.getCookiesForUrl(actualUrl)
34+ .orEmpty()
3135 if (callback.invoke(cookies.joinToString(" ; " ) { " ${it.name} =${it.value} " })) {
3236 onBack.invoke()
3337 break
You can’t perform that action at this time.
0 commit comments