Less warnings

This commit is contained in:
Vitor Pamplona
2026-03-16 16:53:17 -04:00
parent b96c1c2c3a
commit 95c7adc90b
8 changed files with 13 additions and 11 deletions
@@ -128,7 +128,7 @@ class QueryParserTest {
fun untilDate() {
val q = QueryParser.parse("until:2025-12-31")
assertNull(q.since)
assertTrue(q.until != null && q.until!! > 0)
assertTrue(q.until != null && q.until > 0)
}
@Test
@@ -39,6 +39,7 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowLeft
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.filled.Add
@@ -183,7 +184,7 @@ fun ChessScreen(
Row(verticalAlignment = Alignment.CenterVertically) {
if (selectedGameId != null) {
IconButton(onClick = { viewModel.selectGame(null) }) {
Icon(Icons.Default.ArrowBack, "Back to list")
Icon(Icons.AutoMirrored.Default.ArrowBack, "Back to list")
}
Spacer(Modifier.width(8.dp))
}
@@ -86,9 +86,9 @@ class DesktopIAccount(
override val privateZapsDecryptionCache: IPrivateZapsDecryptionCache =
object : IPrivateZapsDecryptionCache {
override fun cachedPrivateZap(zapRequest: LnZapRequestEvent): com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent? = null
override fun cachedPrivateZap(event: LnZapRequestEvent): com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent? = null
override suspend fun decryptPrivateZap(zapRequest: LnZapRequestEvent): com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent? = null
override suspend fun decryptPrivateZap(event: LnZapRequestEvent): com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent? = null
}
override fun userProfile(): User = localCache.getOrCreateUser(pubKey)
@@ -108,7 +108,7 @@ class DesktopIAccount(
override suspend fun sendNip04PrivateMessage(eventTemplate: EventTemplate<PrivateDmEvent>) {
if (!isWriteable()) return
val signedEvent = signer.sign<PrivateDmEvent>(eventTemplate)
val signedEvent = signer.sign(eventTemplate)
val recipient = signedEvent.verifiedRecipientPubKey()
// Optimistic local add so the message appears immediately
@@ -214,7 +214,7 @@ fun UserProfileScreen(
latestMetadataEvent = event
}
}
} catch (e: Exception) {
} catch (_: Exception) {
// Ignore parse errors
}
}
@@ -332,7 +332,7 @@ fun UserProfileScreen(
}
// Edit button for own profile
if (isOwnProfile && account?.isReadOnly == false) {
if (isOwnProfile && account.isReadOnly == false) {
OutlinedButton(
onClick = {
editingDisplayName = displayName ?: ""
@@ -20,7 +20,6 @@
*/
package com.vitorpamplona.amethyst.desktop.ui.auth
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
@@ -41,6 +40,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.commons.resources.Res
import com.vitorpamplona.amethyst.commons.resources.login_hide_key
@@ -20,7 +20,6 @@
*/
package com.vitorpamplona.amethyst.desktop.ui.auth
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@@ -54,6 +53,7 @@ import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.commons.resources.Res
@@ -20,7 +20,6 @@
*/
package com.vitorpamplona.amethyst.desktop.ui.auth
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
@@ -35,6 +34,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.commons.resources.Res
@@ -35,6 +35,7 @@ import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Article
import androidx.compose.material.icons.filled.Article
import androidx.compose.material.icons.filled.Description
import androidx.compose.material.icons.filled.ExpandMore
@@ -185,7 +186,7 @@ fun SearchResultsList(
SortableHeader(
title = "Articles",
count = articles.size,
icon = Icons.Default.Article,
icon = Icons.AutoMirrored.Default.Article,
options = SearchSortOrder.EVENT_OPTIONS,
selected = eventSortOrder,
onSelect = { state.updateEventSortOrder(it) },