amethyst lint

This commit is contained in:
davotoula
2025-12-14 10:20:25 +01:00
parent c2636e6e2f
commit 9ef9fb4b09
4 changed files with 13 additions and 14 deletions
@@ -601,7 +601,7 @@ class Account(
url: String,
method: String,
body: ByteArray? = null,
): HTTPAuthorizationEvent? = signer.sign(HTTPAuthorizationEvent.build(url, method, body))
): HTTPAuthorizationEvent = signer.sign(HTTPAuthorizationEvent.build(url, method, body))
suspend fun createBlossomUploadAuth(
hash: HexKey,
@@ -218,7 +218,7 @@ class User(
fun transientFollowCount(): Int? = latestContactList?.unverifiedFollowKeySet()?.size
suspend fun transientFollowerCount(): Int = LocalCache.users.count { _, it -> it.latestContactList?.isTaggedUser(pubkeyHex) ?: false }
fun transientFollowerCount(): Int = LocalCache.users.count { _, it -> it.latestContactList?.isTaggedUser(pubkeyHex) ?: false }
fun reportsOrNull(): UserReportCache? = reports
@@ -80,14 +80,14 @@ class FollowListsState(
.map { existingPeopleListNotes() }
.onStart { emit(existingPeopleListNotes()) }
.flowOn(Dispatchers.IO)
.stateIn(scope, SharingStarted.Companion.Eagerly, emptyList())
.stateIn(scope, SharingStarted.Eagerly, emptyList())
val followListsEventIds =
followListNotes
.map { it.eventIdSet() }
.onStart { emit(followListNotes.value.eventIdSet()) }
.flowOn(Dispatchers.IO)
.stateIn(scope, SharingStarted.Companion.Eagerly, emptySet())
.stateIn(scope, SharingStarted.Eagerly, emptySet())
@OptIn(ExperimentalCoroutinesApi::class)
val latestLists: StateFlow<List<FollowListEvent>> =
@@ -104,7 +104,7 @@ class FollowListsState(
.map { it.mapToUserIdSet() }
.onStart { emit(latestLists.value.mapToUserIdSet()) }
.flowOn(Dispatchers.IO)
.stateIn(scope, SharingStarted.Companion.Eagerly, emptySet())
.stateIn(scope, SharingStarted.Eagerly, emptySet())
fun FollowListEvent.toUI() =
PeopleList(
@@ -123,7 +123,7 @@ class FollowListsState(
.map { it.toUI() }
.onStart { emit(latestLists.value.toUI()) }
.flowOn(Dispatchers.IO)
.stateIn(scope, SharingStarted.Companion.Eagerly, emptyList())
.stateIn(scope, SharingStarted.Eagerly, emptyList())
fun List<PeopleList>.select(dTag: String) =
this.firstOrNull {
@@ -139,7 +139,7 @@ class FollowListsState(
fun isUserInFollowSets(user: User): Boolean = allPeopleListProfiles.value.contains(user.pubkeyHex)
fun DeletionEvent.hasDeletedAnyFollowList() = deleteAddressesWithKind(FollowListEvent.Companion.KIND) || deletesAnyEventIn(followListsEventIds.value)
fun DeletionEvent.hasDeletedAnyFollowList() = deleteAddressesWithKind(FollowListEvent.KIND) || deletesAnyEventIn(followListsEventIds.value)
fun hasItemInNoteList(notes: Set<Note>): Boolean =
notes.anyNotNullEvent { event ->
@@ -39,7 +39,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@@ -109,13 +108,13 @@ fun ChannelNamePreview() {
SlimListItem(
headlineContent = {
Row(verticalAlignment = Alignment.CenterVertically) {
Row(verticalAlignment = CenterVertically) {
Text("This is my author", Modifier.weight(1f))
TimeAgo(TimeUtils.now())
}
},
supportingContent = {
Row(verticalAlignment = Alignment.CenterVertically) {
Row(verticalAlignment = CenterVertically) {
Text("This is a message from this person", Modifier.weight(1f))
Spacer(modifier = Height4dpModifier)
NewItemsBubble()
@@ -135,13 +134,13 @@ fun ChannelNamePreview() {
ListItem(
headlineContent = {
Row(verticalAlignment = Alignment.CenterVertically) {
Row(verticalAlignment = CenterVertically) {
Text("This is my author", Modifier.weight(1f))
TimeAgo(TimeUtils.now())
}
},
supportingContent = {
Row(verticalAlignment = Alignment.CenterVertically) {
Row(verticalAlignment = CenterVertically) {
Text("This is a message from this person", Modifier.weight(1f))
Spacer(modifier = Height4dpModifier)
NewItemsBubble()
@@ -507,7 +506,7 @@ private class ListItemMeasurePolicy : MultiContentMeasurePolicy {
}
}
private fun IntrinsicMeasureScope.calculateWidth(
private fun calculateWidth(
leadingWidth: Int,
trailingWidth: Int,
headlineWidth: Int,
@@ -644,7 +643,7 @@ private value class ListItemType private constructor(
/** Three line list item */
val ThreeLine = ListItemType(3)
internal operator fun invoke(
operator fun invoke(
hasOverline: Boolean,
hasSupporting: Boolean,
isSupportingMultiline: Boolean,