Skip to content

Commit

Permalink
Fix route resetting when there is a config change
Browse files Browse the repository at this point in the history
The NavType needs to provide valid hashCode() and equals() which it
being a data class happens automatically for us
  • Loading branch information
StylianosGakis committed Jul 31, 2024
1 parent 09075da commit 4889af9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal fun typeMapOf(ktypes: List<KType>): Map<KType, @JvmSuppressWildcards Na
private inline fun <T> KSerializer<*>.cast(): KSerializer<T> = this as KSerializer<T>

@Suppress("NOTHING_TO_INLINE")
internal class JsonSerializableNavType<T : Any>(
internal data class JsonSerializableNavType<T : Any>(
private val serializer: KSerializer<T>,
) : NavType<T>(isNullableAllowed = false) {
override fun put(bundle: Bundle, key: String, value: T) {
Expand All @@ -50,7 +50,7 @@ internal class JsonSerializableNavType<T : Any>(
}

@Suppress("NOTHING_TO_INLINE")
internal class JsonSerializableNullableNavType<T : Any?>(
internal data class JsonSerializableNullableNavType<T : Any?>(
private val serializer: KSerializer<T?>,
) : NavType<T?>(isNullableAllowed = true) {
override fun put(bundle: Bundle, key: String, value: T?) {
Expand Down

0 comments on commit 4889af9

Please sign in to comment.