reduce lint errors

This commit is contained in:
davotoula
2026-05-08 07:38:55 +02:00
parent 4d2019a30c
commit 6039e20879
2 changed files with 10 additions and 8 deletions
@@ -198,15 +198,14 @@ class ScheduledPostWorker(
): Int {
val deadline = System.currentTimeMillis() + OK_TIMEOUT_SEC * 1000
while (System.currentTimeMillis() < deadline) {
val pending = client.pendingPublishRelaysFor(eventId)
// null means the outbox dropped the entry — every relay either OK'd
// or hit the discard cap (replaced/pow/deleted/invalid). Treat as full ack.
if (pending == null) return totalRelays
val pending = client.pendingPublishRelaysFor(eventId) ?: return totalRelays
val acked = totalRelays - pending.size
if (acked > 0) return acked
delay(OK_POLL_MS)
}
val pending = client.pendingPublishRelaysFor(eventId)
return if (pending == null) totalRelays else totalRelays - pending.size
val pending = client.pendingPublishRelaysFor(eventId) ?: return totalRelays
return totalRelays - pending.size
}
}
@@ -66,6 +66,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -77,12 +78,11 @@ import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalClipboard
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
@@ -97,6 +97,7 @@ import com.vitorpamplona.amethyst.service.scheduledposts.ScheduledPost
import com.vitorpamplona.amethyst.service.scheduledposts.ScheduledPostStatus
import com.vitorpamplona.amethyst.service.scheduledposts.ScheduledPostWorker
import com.vitorpamplona.amethyst.ui.components.SwipeToDeleteWithConfirmation
import com.vitorpamplona.amethyst.ui.components.util.setText
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
import com.vitorpamplona.amethyst.ui.navigation.routes.Route
import com.vitorpamplona.amethyst.ui.navigation.topbars.ShorterTopAppBar
@@ -107,6 +108,7 @@ import com.vitorpamplona.amethyst.ui.note.timeAheadNoDot
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.stringRes
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.time.Instant
import java.time.LocalDate
import java.time.ZoneId
@@ -373,7 +375,8 @@ private fun ScheduledPostCardExpandedPanel(
onDelete: () -> Unit,
) {
val context = LocalContext.current
val clipboard = LocalClipboardManager.current
val clipboardManager = LocalClipboard.current
val scope = rememberCoroutineScope()
val eventId = remember(post.id) { extractEventId(post) }
Column(
@@ -410,7 +413,7 @@ private fun ScheduledPostCardExpandedPanel(
.combinedClickable(
onClick = {},
onLongClick = {
clipboard.setText(AnnotatedString(eventId))
scope.launch { clipboardManager.setText(eventId) }
Toast
.makeText(
context,