Skip to content
Snippets Groups Projects
Unverified Commit 6d1e6771 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

fix: wrong account load crash

parent db1d2d74
No related branches found
No related tags found
No related merge requests found
......@@ -87,24 +87,26 @@ fun MeteroidRouter(
MeteroidScreen.Home.Purchase.route, arguments = listOf(
navArgument("server") {
type = NavType.LongType
initialAccount.server?.let { defaultValue = it.value }
defaultValue = initialAccount.server?.value ?: -1L
},
navArgument("user") {
type = NavType.LongType
initialAccount.user?.let { defaultValue = it.value }
defaultValue = initialAccount.user?.value ?: -1L
},
)
) { entry ->
val serverId = entry.arguments?.getLong("server")?.let(::ServerId)
?: ServerId(-1L)
val userId = entry.arguments?.getLong("user")?.let(::UserId)
?: UserId(-1L)
LaunchedEffect(serverId, userId) {
if (serverId == null || userId == null) {
if (!serverId.isValid() || !userId.isValid()) {
navigationViewModel.expanded.value = true
}
}
if (serverId != null && userId != null) {
if (serverId.isValid() && userId.isValid()) {
val viewModel: PurchaseViewModel = hiltViewModel(
key = MeteroidScreen.Home.Purchase.build(serverId, userId)
)
......
......@@ -22,7 +22,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx4096m
org.gradle.configuration-cache=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
......
package util
import org.gradle.api.Project
import java.io.ByteArrayOutputStream
import java.util.*
@Suppress("UnstableApiUsage")
fun Project.cmd(vararg command: String) = try {
val stdOut = ByteArrayOutputStream()
exec {
providers.exec {
commandLine(*command)
standardOutput = stdOut
}
stdOut.toString(Charsets.UTF_8.name()).trim()
}.standardOutput.asText.get().trim()
} catch (e: Throwable) {
e.printStackTrace()
null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment