From 34e1ea92b2868d2905a44c16209fa64b2fc9228e Mon Sep 17 00:00:00 2001 From: davotoula Date: Fri, 6 Mar 2026 17:15:32 +0100 Subject: [PATCH] Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable. --- .../java/com/vitorpamplona/amethyst/ui/note/TimeAgoFormatter.kt | 2 +- .../screen/loggedIn/notifications/NotificationSummaryState.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/TimeAgoFormatter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/TimeAgoFormatter.kt index 99d2cc893..107bd36aa 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/TimeAgoFormatter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/TimeAgoFormatter.kt @@ -32,7 +32,7 @@ import kotlin.math.round private const val YEAR_DATE_FORMAT = "MMM dd, yyyy" private const val MONTH_DATE_FORMAT = "MMM dd" -var locale = Locale.getDefault() +var locale: Locale = Locale.getDefault() var yearFormatter = SimpleDateFormat(YEAR_DATE_FORMAT, locale) var monthFormatter = SimpleDateFormat(MONTH_DATE_FORMAT, locale) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt index 38799f3bf..9ed5f27d5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt @@ -82,7 +82,7 @@ class NotificationSummaryState( Instant.ofEpochSecond(createAt).atZone(ZoneId.systemDefault()).toLocalDateTime(), ) - fun today() = sdf.format(LocalDateTime.now()) + fun today(): String = sdf.format(LocalDateTime.now()) public suspend fun initializeSuspend() { checkNotInMainThread()