Merge remote-tracking branch 'upstream/main' into NIP90-ContentDiscovery

This commit is contained in:
Believethehype 2024-05-14 17:06:00 +02:00
commit 11a5f4a67e
3 changed files with 7 additions and 4 deletions

View File

@ -210,10 +210,12 @@ open class Note(val idHex: String) {
} }
} }
val levelFormatter = DateTimeFormatter.ofPattern("uuuu-MM-dd-HH:mm:ss")
fun formattedDateTime(timestamp: Long): String { fun formattedDateTime(timestamp: Long): String {
return Instant.ofEpochSecond(timestamp) return Instant.ofEpochSecond(timestamp)
.atZone(ZoneId.systemDefault()) .atZone(ZoneId.systemDefault())
.format(DateTimeFormatter.ofPattern("uuuu-MM-dd-HH:mm:ss")) .format(levelFormatter)
} }
data class LevelSignature(val signature: String, val createdAt: Long?, val author: User?) data class LevelSignature(val signature: String, val createdAt: Long?, val author: User?)

View File

@ -569,7 +569,7 @@ private fun RenderNoteRow(
is AppDefinitionEvent -> RenderAppDefinition(baseNote, accountViewModel, nav) is AppDefinitionEvent -> RenderAppDefinition(baseNote, accountViewModel, nav)
is AudioTrackEvent -> RenderAudioTrack(baseNote, accountViewModel, nav) is AudioTrackEvent -> RenderAudioTrack(baseNote, accountViewModel, nav)
is AudioHeaderEvent -> RenderAudioHeader(baseNote, accountViewModel, nav) is AudioHeaderEvent -> RenderAudioHeader(baseNote, accountViewModel, nav)
is DraftEvent -> RenderDraft(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) is DraftEvent -> RenderDraft(baseNote, quotesLeft, unPackReply, backgroundColor, accountViewModel, nav)
is ReactionEvent -> RenderReaction(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) is ReactionEvent -> RenderReaction(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
is RepostEvent -> RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) is RepostEvent -> RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
is GenericRepostEvent -> RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) is GenericRepostEvent -> RenderRepost(baseNote, quotesLeft, backgroundColor, accountViewModel, nav)
@ -756,6 +756,7 @@ fun ObserveDraftEvent(
fun RenderDraft( fun RenderDraft(
note: Note, note: Note,
quotesLeft: Int, quotesLeft: Int,
unPackReply: Boolean,
backgroundColor: MutableState<Color>, backgroundColor: MutableState<Color>,
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: (String) -> Unit, nav: (String) -> Unit,
@ -770,7 +771,7 @@ fun RenderDraft(
canPreview = true, canPreview = true,
editState = edits, editState = edits,
quotesLeft = quotesLeft, quotesLeft = quotesLeft,
unPackReply = true, unPackReply = unPackReply,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) )

View File

@ -554,7 +554,7 @@ fun NoteMaster(
} else if (noteEvent is AppDefinitionEvent) { } else if (noteEvent is AppDefinitionEvent) {
RenderAppDefinition(baseNote, accountViewModel, nav) RenderAppDefinition(baseNote, accountViewModel, nav)
} else if (noteEvent is DraftEvent) { } else if (noteEvent is DraftEvent) {
RenderDraft(baseNote, 3, backgroundColor, accountViewModel, nav) RenderDraft(baseNote, 3, true, backgroundColor, accountViewModel, nav)
} else if (noteEvent is HighlightEvent) { } else if (noteEvent is HighlightEvent) {
DisplayHighlight( DisplayHighlight(
noteEvent.quote(), noteEvent.quote(),