Skip to content

Commit

Permalink
Updated compose to 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JetpackDuba committed Mar 5, 2024
1 parent 52f699d commit fb3b7fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
kotlin("jvm") version "1.9.20"
kotlin("plugin.serialization") version "1.9.20"
id("com.google.devtools.ksp") version "1.9.20-1.0.14"
id("org.jetbrains.compose") version "1.5.11"
id("org.jetbrains.compose") version "1.6.0"
}

// Remember to update Constants.APP_VERSION when changing this version
Expand Down
9 changes: 8 additions & 1 deletion src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ import org.eclipse.jgit.submodule.SubmoduleStatusType
import org.jetbrains.compose.animatedimage.Blank
import org.jetbrains.compose.animatedimage.animate
import org.jetbrains.compose.animatedimage.loadAnimatedImage
import org.jetbrains.compose.resources.loadOrNull
import java.io.FileInputStream
import kotlin.math.max

private const val MAX_MOVES_COUNT = 5
@Composable
private fun <T> loadOrNull(key: Any, action: suspend () -> T?): T? {
var result: T? by remember(key) { mutableStateOf(null) }
LaunchedEffect(Unit) {
result = action()
}
return result
}

@Composable
fun Diff(
Expand Down

0 comments on commit fb3b7fa

Please sign in to comment.