Merge pull request #1746 from davotoula/cleaner-code

Cleaner code
This commit is contained in:
Vitor Pamplona
2026-03-03 06:46:34 -05:00
committed by GitHub
16 changed files with 102 additions and 64 deletions
@@ -229,7 +229,9 @@ interface ILocalCache {
fun markAsSeen( fun markAsSeen(
eventId: String, eventId: String,
relay: NormalizedRelayUrl, relay: NormalizedRelayUrl,
) {} ) {
// Default no-op; implementations may override to track seen events per relay
}
} }
object LocalCache : ILocalCache, ICacheProvider { object LocalCache : ILocalCache, ICacheProvider {
@@ -91,6 +91,7 @@ class MeltProcessor {
onError: (String, String) -> Unit, onError: (String, String) -> Unit,
context: Context, context: Context,
) { ) {
// TODO: Implement Cashu token melting via Lightning invoice
} }
suspend fun feeCalculator( suspend fun feeCalculator(
@@ -110,5 +110,7 @@ class ByteArrayMediaDataSource(
} }
@Throws(IOException::class) @Throws(IOException::class)
override fun close() {} override fun close() {
// No resources to release; data is an in-memory byte array
}
} }
@@ -199,12 +199,16 @@ object VideoCompressionHelper {
), ),
listener = listener =
object : CompressionListener { object : CompressionListener {
override fun onStart(index: Int) {} override fun onStart(index: Int) {
// No action needed on compression start
}
override fun onProgress( override fun onProgress(
index: Int, index: Int,
percent: Float, percent: Float,
) {} ) {
// Progress tracking not needed for this use case
}
override fun onSuccess( override fun onSuccess(
index: Int, index: Int,
@@ -117,6 +117,8 @@ fun RenderContentAsMarkdown(
} }
} }
private const val PREVIEW_CALLBACK_URI = "nostr:something"
@Preview @Preview
@Composable @Composable
fun RenderContentAsMarkdownPreview() { fun RenderContentAsMarkdownPreview() {
@@ -162,7 +164,7 @@ fun RenderContentAsMarkdownPreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -212,7 +214,7 @@ fun RenderContentAsMarkdownListsPreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -266,7 +268,7 @@ fun RenderContentAsMarkdownCodePreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -306,7 +308,7 @@ fun RenderContentAsMarkdownTablesPreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -344,7 +346,7 @@ fun RenderContentAsMarkdownFootNotesPreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -405,7 +407,7 @@ fun RenderContentAsMarkdownUserPreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -455,7 +457,7 @@ fun RenderContentAsMarkdownNotePreview() {
remember { remember {
mutableStateOf(background) mutableStateOf(background)
}, },
callbackUri = "nostr:something", callbackUri = PREVIEW_CALLBACK_URI,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )
@@ -106,7 +106,9 @@ class ChannelFeedContentState(
} }
} }
fun deleteFromFeed(deletedNotes: Set<Note>) {} fun deleteFromFeed(deletedNotes: Set<Note>) {
// TODO: Implement deletion of notes from the channel feed
}
fun refreshFromOldState(newItems: Set<Note>) { fun refreshFromOldState(newItems: Set<Note>) {
val oldNotesState = _feedContent.value val oldNotesState = _feedContent.value
@@ -51,6 +51,9 @@ import com.vitorpamplona.amethyst.ui.theme.Size55Modifier
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonColumn import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonColumn
import com.vitorpamplona.quartz.utils.TimeUtils import com.vitorpamplona.quartz.utils.TimeUtils
private const val PREVIEW_AUTHOR = "This is my author"
private const val PREVIEW_MESSAGE = "This is a message from this person"
@Composable @Composable
@Preview @Preview
fun ChannelNamePreview() { fun ChannelNamePreview() {
@@ -65,11 +68,11 @@ fun ChannelNamePreview() {
) )
}, },
firstRow = { firstRow = {
Text("This is my author", Modifier.weight(1f)) Text(PREVIEW_AUTHOR, Modifier.weight(1f))
TimeAgo(TimeUtils.now()) TimeAgo(TimeUtils.now())
}, },
secondRow = { secondRow = {
Text("This is a message from this person", Modifier.weight(1f)) Text(PREVIEW_MESSAGE, Modifier.weight(1f))
Spacer(modifier = Height4dpModifier) Spacer(modifier = Height4dpModifier)
NewItemsBubble() NewItemsBubble()
}, },
@@ -81,13 +84,13 @@ fun ChannelNamePreview() {
ListItem( ListItem(
headlineContent = { headlineContent = {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Text("This is my author", Modifier.weight(1f)) Text(PREVIEW_AUTHOR, Modifier.weight(1f))
TimeAgo(TimeUtils.now()) TimeAgo(TimeUtils.now())
} }
}, },
supportingContent = { supportingContent = {
Row { Row {
Text("This is a message from this person", Modifier.weight(1f)) Text(PREVIEW_MESSAGE, Modifier.weight(1f))
NewItemsBubble() NewItemsBubble()
} }
}, },
@@ -106,13 +109,13 @@ fun ChannelNamePreview() {
SlimListItem( SlimListItem(
headlineContent = { headlineContent = {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Text("This is my author", Modifier.weight(1f)) Text(PREVIEW_AUTHOR, Modifier.weight(1f))
TimeAgo(TimeUtils.now()) TimeAgo(TimeUtils.now())
} }
}, },
supportingContent = { supportingContent = {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Text("This is a message from this person", Modifier.weight(1f)) Text(PREVIEW_MESSAGE, Modifier.weight(1f))
NewItemsBubble() NewItemsBubble()
} }
}, },
@@ -80,6 +80,9 @@ import kotlin.math.max
* This is a copy of Material3's ListItemLayout.kt file, with the only change being the padding change from 16.dp to 10.dp * This is a copy of Material3's ListItemLayout.kt file, with the only change being the padding change from 16.dp to 10.dp
*/ */
private const val PREVIEW_AUTHOR = "This is my author"
private const val PREVIEW_MESSAGE = "This is a message from this person"
@Composable @Composable
@Preview @Preview
fun ChannelNamePreview() { fun ChannelNamePreview() {
@@ -94,11 +97,11 @@ fun ChannelNamePreview() {
) )
}, },
firstRow = { firstRow = {
Text("This is my author", Modifier.weight(1f)) Text(PREVIEW_AUTHOR, Modifier.weight(1f))
TimeAgo(TimeUtils.now()) TimeAgo(TimeUtils.now())
}, },
secondRow = { secondRow = {
Text("This is a message from this person", Modifier.weight(1f)) Text(PREVIEW_MESSAGE, Modifier.weight(1f))
NewItemsBubble() NewItemsBubble()
}, },
onClick = {}, onClick = {},
@@ -109,13 +112,13 @@ fun ChannelNamePreview() {
SlimListItem( SlimListItem(
headlineContent = { headlineContent = {
Row(verticalAlignment = CenterVertically) { Row(verticalAlignment = CenterVertically) {
Text("This is my author", Modifier.weight(1f)) Text(PREVIEW_AUTHOR, Modifier.weight(1f))
TimeAgo(TimeUtils.now()) TimeAgo(TimeUtils.now())
} }
}, },
supportingContent = { supportingContent = {
Row(verticalAlignment = CenterVertically) { Row(verticalAlignment = CenterVertically) {
Text("This is a message from this person", Modifier.weight(1f)) Text(PREVIEW_MESSAGE, Modifier.weight(1f))
Spacer(modifier = Height4dpModifier) Spacer(modifier = Height4dpModifier)
NewItemsBubble() NewItemsBubble()
} }
@@ -135,13 +138,13 @@ fun ChannelNamePreview() {
ListItem( ListItem(
headlineContent = { headlineContent = {
Row(verticalAlignment = CenterVertically) { Row(verticalAlignment = CenterVertically) {
Text("This is my author", Modifier.weight(1f)) Text(PREVIEW_AUTHOR, Modifier.weight(1f))
TimeAgo(TimeUtils.now()) TimeAgo(TimeUtils.now())
} }
}, },
supportingContent = { supportingContent = {
Row(verticalAlignment = CenterVertically) { Row(verticalAlignment = CenterVertically) {
Text("This is a message from this person", Modifier.weight(1f)) Text(PREVIEW_MESSAGE, Modifier.weight(1f))
Spacer(modifier = Height4dpModifier) Spacer(modifier = Height4dpModifier)
NewItemsBubble() NewItemsBubble()
} }
@@ -37,6 +37,7 @@ class EmptyNav : INav {
override fun openDrawer() = runBlocking { drawerState.open() } override fun openDrawer() = runBlocking { drawerState.open() }
// All navigation methods are intentionally no-op; this is a stub for previews and tests
override fun nav(route: Route) {} override fun nav(route: Route) {}
override fun nav(computeRoute: suspend () -> Route?) {} override fun nav(computeRoute: suspend () -> Route?) {}
@@ -1542,33 +1542,38 @@ fun ReactionChoicePopupContent(
} }
} }
private const val EMOJI_ROCKET = "\uD83D\uDE80"
private const val EMOJI_THINKING = "\uD83E\uDD14"
private const val EMOJI_SCREAM = "\uD83D\uDE31"
private const val EMOJI_PARTY = "\uD83C\uDF89"
@Preview() @Preview()
@Composable @Composable
fun ReactionChoicePopupPeeview() { fun ReactionChoicePopupPeeview() {
ThemeComparisonColumn { ThemeComparisonColumn {
ReactionChoicePopupContent( ReactionChoicePopupContent(
persistentListOf( persistentListOf(
"\uD83D\uDE80", EMOJI_ROCKET,
"\uD83E\uDEC2", "\uD83E\uDEC2",
"\uD83D\uDC40", "\uD83D\uDC40",
"\uD83D\uDE02", "\uD83D\uDE02",
"\uD83C\uDF89", EMOJI_PARTY,
"\uD83E\uDD14", EMOJI_THINKING,
"\uD83D\uDE31", EMOJI_SCREAM,
"\uD83E\uDD14", EMOJI_THINKING,
"\uD83D\uDE31", EMOJI_SCREAM,
"+", "+",
"-", "-",
"\uD83C\uDF89", EMOJI_PARTY,
"\uD83E\uDD14", EMOJI_THINKING,
"\uD83D\uDE31", EMOJI_SCREAM,
"\uD83E\uDD14", EMOJI_THINKING,
"\uD83D\uDE31", EMOJI_SCREAM,
"\uD83D\uDE80\uDB40\uDD58\uDB40\uDD64\uDB40\uDD64\uDB40\uDD60\uDB40\uDD63\uDB40\uDD2A\uDB40\uDD1F\uDB40\uDD1F\uDB40\uDD53\uDB40\uDD54\uDB40\uDD5E\uDB40\uDD1E\uDB40\uDD63\uDB40\uDD51\uDB40\uDD64\uDB40\uDD55\uDB40\uDD5C\uDB40\uDD5C\uDB40\uDD59\uDB40\uDD64\uDB40\uDD55\uDB40\uDD1E\uDB40\uDD55\uDB40\uDD51\uDB40\uDD62\uDB40\uDD64\uDB40\uDD58\uDB40\uDD1F\uDB40\uDD29\uDB40\uDD24\uDB40\uDD27\uDB40\uDD55\uDB40\uDD24\uDB40\uDD51\uDB40\uDD52\uDB40\uDD22\uDB40\uDD54\uDB40\uDD23\uDB40\uDD21\uDB40\uDD21\uDB40\uDD25\uDB40\uDD52\uDB40\uDD55\uDB40\uDD25\uDB40\uDD26\uDB40\uDD25\uDB40\uDD51\uDB40\uDD24\uDB40\uDD29\uDB40\uDD53\uDB40\uDD56\uDB40\uDD25\uDB40\uDD54\uDB40\uDD52\uDB40\uDD20\uDB40\uDD22\uDB40\uDD25\uDB40\uDD25\uDB40\uDD29\uDB40\uDD56\uDB40\uDD23\uDB40\uDD21\uDB40\uDD20\uDB40\uDD53\uDB40\uDD51\uDB40\uDD20\uDB40\uDD51\uDB40\uDD26\uDB40\uDD54\uDB40\uDD54\uDB40\uDD56\uDB40\uDD54\uDB40\uDD54\uDB40\uDD52\uDB40\uDD54\uDB40\uDD24\uDB40\uDD52\uDB40\uDD54\uDB40\uDD28\uDB40\uDD53\uDB40\uDD52\uDB40\uDD55\uDB40\uDD53\uDB40\uDD24\uDB40\uDD24\uDB40\uDD29\uDB40\uDD29\uDB40\uDD25\uDB40\uDD53\uDB40\uDD22\uDB40\uDD55\uDB40\uDD27\uDB40\uDD1E\uDB40\uDD67\uDB40\uDD55\uDB40\uDD52\uDB40\uDD60", "\uD83D\uDE80\uDB40\uDD58\uDB40\uDD64\uDB40\uDD64\uDB40\uDD60\uDB40\uDD63\uDB40\uDD2A\uDB40\uDD1F\uDB40\uDD1F\uDB40\uDD53\uDB40\uDD54\uDB40\uDD5E\uDB40\uDD1E\uDB40\uDD63\uDB40\uDD51\uDB40\uDD64\uDB40\uDD55\uDB40\uDD5C\uDB40\uDD5C\uDB40\uDD59\uDB40\uDD64\uDB40\uDD55\uDB40\uDD1E\uDB40\uDD55\uDB40\uDD51\uDB40\uDD62\uDB40\uDD64\uDB40\uDD58\uDB40\uDD1F\uDB40\uDD29\uDB40\uDD24\uDB40\uDD27\uDB40\uDD55\uDB40\uDD24\uDB40\uDD51\uDB40\uDD52\uDB40\uDD22\uDB40\uDD54\uDB40\uDD23\uDB40\uDD21\uDB40\uDD21\uDB40\uDD25\uDB40\uDD52\uDB40\uDD55\uDB40\uDD25\uDB40\uDD26\uDB40\uDD25\uDB40\uDD51\uDB40\uDD24\uDB40\uDD29\uDB40\uDD53\uDB40\uDD56\uDB40\uDD25\uDB40\uDD54\uDB40\uDD52\uDB40\uDD20\uDB40\uDD22\uDB40\uDD25\uDB40\uDD25\uDB40\uDD29\uDB40\uDD56\uDB40\uDD23\uDB40\uDD21\uDB40\uDD20\uDB40\uDD53\uDB40\uDD51\uDB40\uDD20\uDB40\uDD51\uDB40\uDD26\uDB40\uDD54\uDB40\uDD54\uDB40\uDD56\uDB40\uDD54\uDB40\uDD54\uDB40\uDD52\uDB40\uDD54\uDB40\uDD24\uDB40\uDD52\uDB40\uDD54\uDB40\uDD28\uDB40\uDD53\uDB40\uDD52\uDB40\uDD55\uDB40\uDD53\uDB40\uDD24\uDB40\uDD24\uDB40\uDD29\uDB40\uDD29\uDB40\uDD25\uDB40\uDD53\uDB40\uDD22\uDB40\uDD55\uDB40\uDD27\uDB40\uDD1E\uDB40\uDD67\uDB40\uDD55\uDB40\uDD52\uDB40\uDD60",
), ),
onClick = {}, onClick = {},
onChangeAmount = {}, onChangeAmount = {},
toRemove = persistentSetOf("\uD83D\uDE80", "\uD83E\uDD14", "\uD83D\uDE31"), toRemove = persistentSetOf(EMOJI_ROCKET, EMOJI_THINKING, EMOJI_SCREAM),
) )
} }
} }
@@ -433,6 +433,10 @@ fun ObserveAndDrawInnerUserPicture(
) )
} }
private const val PREVIEW_USER_HEX = "989c3734c46abac7ce3ce229971581a5a6ee39cdd6aa7261a55823fa7f8c4799"
private const val PREVIEW_PICTURE_URL = "http://null"
private const val PREVIEW_USER_NAME = "vitor"
@Preview @Preview
@Composable @Composable
fun ScoreTag55Preview() { fun ScoreTag55Preview() {
@@ -442,9 +446,9 @@ fun ScoreTag55Preview() {
var size = 75.dp var size = 75.dp
Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) { Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) {
InnerUserPicture( InnerUserPicture(
userHex = "989c3734c46abac7ce3ce229971581a5a6ee39cdd6aa7261a55823fa7f8c4799", userHex = PREVIEW_USER_HEX,
userPicture = "http://null", userPicture = PREVIEW_PICTURE_URL,
userName = "vitor", userName = PREVIEW_USER_NAME,
size = size, size = size,
modifier = Modifier, modifier = Modifier,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
@@ -455,9 +459,9 @@ fun ScoreTag55Preview() {
size = 55.dp size = 55.dp
Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) { Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) {
InnerUserPicture( InnerUserPicture(
userHex = "989c3734c46abac7ce3ce229971581a5a6ee39cdd6aa7261a55823fa7f8c4799", userHex = PREVIEW_USER_HEX,
userPicture = "http://null", userPicture = PREVIEW_PICTURE_URL,
userName = "vitor", userName = PREVIEW_USER_NAME,
size = size, size = size,
modifier = Modifier, modifier = Modifier,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
@@ -468,9 +472,9 @@ fun ScoreTag55Preview() {
size = 35.dp size = 35.dp
Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) { Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) {
InnerUserPicture( InnerUserPicture(
userHex = "989c3734c46abac7ce3ce229971581a5a6ee39cdd6aa7261a55823fa7f8c4799", userHex = PREVIEW_USER_HEX,
userPicture = "http://null", userPicture = PREVIEW_PICTURE_URL,
userName = "vitor", userName = PREVIEW_USER_NAME,
size = size, size = size,
modifier = Modifier, modifier = Modifier,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
@@ -481,9 +485,9 @@ fun ScoreTag55Preview() {
size = 25.dp size = 25.dp
Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) { Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) {
InnerUserPicture( InnerUserPicture(
userHex = "989c3734c46abac7ce3ce229971581a5a6ee39cdd6aa7261a55823fa7f8c4799", userHex = PREVIEW_USER_HEX,
userPicture = "http://null", userPicture = PREVIEW_PICTURE_URL,
userName = "vitor", userName = PREVIEW_USER_NAME,
size = size, size = size,
modifier = Modifier, modifier = Modifier,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
@@ -495,8 +499,8 @@ fun ScoreTag55Preview() {
Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) { Box(Modifier.size(size), contentAlignment = Alignment.TopEnd) {
InnerUserPicture( InnerUserPicture(
userHex = "AABBCC", userHex = "AABBCC",
userPicture = "http://null", userPicture = PREVIEW_PICTURE_URL,
userName = "vitor", userName = PREVIEW_USER_NAME,
size = size, size = size,
modifier = Modifier, modifier = Modifier,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
@@ -102,7 +102,9 @@ class ZapOptionViewModel : ViewModel() {
fun value(): Long? = customAmount.text.trim().toLongOrNull() fun value(): Long? = customAmount.text.trim().toLongOrNull()
fun cancel() {} fun cancel() {
// No cleanup needed; dialog state is reset on close
}
} }
@Composable @Composable
@@ -141,6 +141,7 @@ class EventProcessor(
} }
interface EventHandler<T : IEvent> { interface EventHandler<T : IEvent> {
// Default no-ops; implementations override only the operations they handle
suspend fun add( suspend fun add(
event: T, event: T,
eventNote: Note, eventNote: Note,
@@ -71,6 +71,10 @@ import com.vitorpamplona.amethyst.ui.theme.SpacedBy2dp
import com.vitorpamplona.amethyst.ui.theme.SpacedBy5dp import com.vitorpamplona.amethyst.ui.theme.SpacedBy5dp
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonColumn import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonColumn
private const val PREVIEW_LIST_TITLE = "Sample List Title"
private const val PREVIEW_LIST_DESCRIPTION = "Sample List Description"
private const val PREVIEW_LIST_IMAGE = "http://some.com/image.png"
@Preview() @Preview()
@Composable @Composable
private fun PeopleListItemPreview() { private fun PeopleListItemPreview() {
@@ -82,8 +86,8 @@ private fun PeopleListItemPreview() {
PeopleList( PeopleList(
identifierTag = "00001-2222", identifierTag = "00001-2222",
title = "Sample List Title, Very long title, very very very long", title = "Sample List Title, Very long title, very very very long",
description = "Sample List Description", description = PREVIEW_LIST_DESCRIPTION,
image = "http://some.com/image.png", image = PREVIEW_LIST_IMAGE,
emptySet(), emptySet(),
emptySet(), emptySet(),
) )
@@ -91,9 +95,9 @@ private fun PeopleListItemPreview() {
val samplePeopleList2 = val samplePeopleList2 =
PeopleList( PeopleList(
identifierTag = "00001-2223", identifierTag = "00001-2223",
title = "Sample List Title", title = PREVIEW_LIST_TITLE,
description = "Sample List Description", description = PREVIEW_LIST_DESCRIPTION,
image = "http://some.com/image.png", image = PREVIEW_LIST_IMAGE,
setOf(user1, user3), setOf(user1, user3),
emptySet(), emptySet(),
) )
@@ -101,9 +105,9 @@ private fun PeopleListItemPreview() {
val samplePeopleList3 = val samplePeopleList3 =
PeopleList( PeopleList(
identifierTag = "00001-2224", identifierTag = "00001-2224",
title = "Sample List Title", title = PREVIEW_LIST_TITLE,
description = "Sample List Description", description = PREVIEW_LIST_DESCRIPTION,
image = "http://some.com/image.png", image = PREVIEW_LIST_IMAGE,
emptySet(), emptySet(),
setOf(user1, user3), setOf(user1, user3),
) )
@@ -111,9 +115,9 @@ private fun PeopleListItemPreview() {
val samplePeopleList4 = val samplePeopleList4 =
PeopleList( PeopleList(
identifierTag = "00001-2225", identifierTag = "00001-2225",
title = "Sample List Title", title = PREVIEW_LIST_TITLE,
description = "Sample List Description", description = PREVIEW_LIST_DESCRIPTION,
image = "http://some.com/image.png", image = PREVIEW_LIST_IMAGE,
setOf(user3), setOf(user3),
setOf(user1, user2, user3), setOf(user1, user2, user3),
) )
@@ -92,7 +92,7 @@ class CardFeedContentState(
viewModelScope.launch(Dispatchers.IO) { _scrollToTop.emit(_scrollToTop.value + 1) } viewModelScope.launch(Dispatchers.IO) { _scrollToTop.emit(_scrollToTop.value + 1) }
} }
suspend fun sentToTop() { fun sentToTop() {
scrolltoTopPending = false scrolltoTopPending = false
} }
@@ -212,7 +212,7 @@ class CardFeedContentState(
val zapRequest = event.zapRequest val zapRequest = event.zapRequest
if (zapRequest != null) { if (zapRequest != null) {
val zapRequestNote = LocalCache.getNoteIfExists(zapRequest.id) val zapRequestNote = getNoteIfExists(zapRequest.id)
if (zapRequestNote != null) { if (zapRequestNote != null) {
zapsPerUser zapsPerUser
.getOrPut(author, { mutableListOf() }) .getOrPut(author, { mutableListOf() })
@@ -352,6 +352,7 @@ class CardFeedContentState(
} }
fun deleteFromFeed(deletedNotes: Set<Note>) { fun deleteFromFeed(deletedNotes: Set<Note>) {
// TODO: Implement deletion of notes from the notification feed
} }
private fun refreshFromOldState(newItems: Set<Note>) { private fun refreshFromOldState(newItems: Set<Note>) {
@@ -57,5 +57,6 @@ class ConnectedRelayListViewModel : BasicRelaySetupInfoModel() {
.sorted() .sorted()
override suspend fun saveRelayList(urlList: List<NormalizedRelayUrl>) { override suspend fun saveRelayList(urlList: List<NormalizedRelayUrl>) {
// Connected relays are read-only; saving is not applicable
} }
} }