mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2024-09-30 08:50:44 +00:00
actually use the image from the 10011 event
This commit is contained in:
parent
5cbea6999e
commit
16eb6097ce
@ -139,6 +139,8 @@ open class Note(
|
||||
var relays = listOf<RelayBriefInfoCache.RelayBriefInfo>()
|
||||
private set
|
||||
|
||||
var headerImage: String? = null
|
||||
|
||||
var lastReactionsDownloadTime: Map<String, EOSETime> = emptyMap()
|
||||
|
||||
fun id() = Hex.decode(idHex)
|
||||
|
@ -34,7 +34,7 @@ class UserProfileGalleryFeedFilter(val user: User, val account: Account) : FeedF
|
||||
val notes =
|
||||
user.latestGalleryList
|
||||
?.taggedGalleryEntries()
|
||||
?.mapNotNull { LocalCache.checkGetOrCreateNote(it.id) }
|
||||
?.map { Pair(LocalCache.getOrCreateNote(it.id), it.url) }
|
||||
?.toSet()
|
||||
?: emptySet()
|
||||
|
||||
@ -46,7 +46,15 @@ class UserProfileGalleryFeedFilter(val user: User, val account: Account) : FeedF
|
||||
?: emptySet() */
|
||||
|
||||
// .sortedWith(DefaultFeedOrder)
|
||||
return (notes)
|
||||
|
||||
var finalnotes = setOf<Note>()
|
||||
for (pair in notes) {
|
||||
pair.first.headerImage = pair.second
|
||||
finalnotes = finalnotes + pair.first
|
||||
}
|
||||
println(finalnotes)
|
||||
|
||||
return (finalnotes)
|
||||
.filter { account.isAcceptable(it) }
|
||||
}
|
||||
}
|
||||
|
@ -669,7 +669,11 @@ fun DeleteFromGalleryDialog(
|
||||
buttonIcon = Icons.Default.Delete,
|
||||
buttonText = stringRes(R.string.quick_action_delete_dialog_btn),
|
||||
onClickDoOnce = {
|
||||
note.event?.firstTaggedUrl()?.let { accountViewModel.removefromMediaGallery(note, it) }
|
||||
note.headerImage.let {
|
||||
if (it != null) {
|
||||
accountViewModel.removefromMediaGallery(note, it)
|
||||
}
|
||||
}
|
||||
onDismiss()
|
||||
},
|
||||
onDismiss = onDismiss,
|
||||
|
@ -282,10 +282,9 @@ fun RenderGalleryThumb(
|
||||
.metadata
|
||||
.map {
|
||||
val noteEvent = baseNote.event as TextNoteEvent
|
||||
|
||||
GalleryThumb(
|
||||
id = "",
|
||||
image = noteEvent.firstTaggedUrl(),
|
||||
image = baseNote.headerImage,
|
||||
title = noteEvent.content(),
|
||||
// noteEvent?.title(),
|
||||
// price = noteEvent?.price(),
|
||||
@ -294,7 +293,7 @@ fun RenderGalleryThumb(
|
||||
.observeAsState(
|
||||
GalleryThumb(
|
||||
id = "",
|
||||
image = noteEvent.firstTaggedUrl(),
|
||||
image = baseNote.headerImage,
|
||||
title = noteEvent.content(),
|
||||
// image = noteEvent.image(),
|
||||
// title = noteEvent.title(),
|
||||
@ -342,6 +341,8 @@ fun InnerRenderGalleryThumb(
|
||||
)
|
||||
} ?: run { DisplayGalleryAuthorBanner(note) }
|
||||
|
||||
// TODO what if video?
|
||||
|
||||
/* Row(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
|
Loading…
Reference in New Issue
Block a user