Browse Source

Examples. Issues stayed opened even after closing the window

pull/1312/head
Igor Demin 3 years ago
parent
commit
591475fa08
  1. 9
      examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt

9
examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt

@ -1,6 +1,7 @@
package androidx.ui.examples.jetissues package androidx.ui.examples.jetissues
import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.WindowSize import androidx.compose.ui.window.WindowSize
@ -11,17 +12,21 @@ import androidx.ui.examples.jetissues.view.Repository
import androidx.ui.examples.jetissues.data.IssuesRepositoryImpl import androidx.ui.examples.jetissues.data.IssuesRepositoryImpl
import androidx.ui.examples.jetissues.data.defaultAuth import androidx.ui.examples.jetissues.data.defaultAuth
import androidx.ui.examples.jetissues.data.defaultRepo import androidx.ui.examples.jetissues.data.defaultRepo
import kotlin.system.exitProcess
val repo = IssuesRepositoryImpl(defaultRepo.first, defaultRepo.second, System.getenv("GITHUB_TOKEN") ?: defaultAuth) val repo = IssuesRepositoryImpl(defaultRepo.first, defaultRepo.second, System.getenv("GITHUB_TOKEN") ?: defaultAuth)
fun main() = application { fun main() {
application {
Window( Window(
onCloseRequest = ::exitApplication, onCloseRequest = ::exitApplication,
title = "JetIssues", title = "JetIssues",
state = WindowState(size = WindowSize(1440.dp, 768.dp)) state = WindowState(size = DpSize(1440.dp, 768.dp))
) { ) {
CompositionLocalProvider(Repository provides repo) { CompositionLocalProvider(Repository provides repo) {
JetIssuesView() JetIssuesView()
} }
} }
} }
exitProcess(0) // force close Apollo Client, using inside IssuesRepositoryImpl
}
Loading…
Cancel
Save