1. Merged main — Picked up missing vanish string resources

2. ShortNotePostViewModel.kt — Added messageState/forwardZapToEdittingState fields and removed stale override keywords to match updated IMessageField/IZapField interfaces
3. ChatNewMessageViewModel.kt — Same pattern: added messageState, forwardZapToEdittingState, toUsersState, subjectState fields and removed stale override keywords
This commit is contained in:
davotoula
2026-03-28 16:30:30 +00:00
committed by Claude
parent 77a0a00a1a
commit 09b3d3be8a
2 changed files with 12 additions and 5 deletions
@@ -21,6 +21,7 @@
package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.privateDM.send
import android.content.Context
import androidx.compose.foundation.text.input.TextFieldState
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableLongStateOf
@@ -107,7 +108,6 @@ import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.emitAll
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapNotNull
import kotlinx.coroutines.flow.onCompletion
import kotlinx.coroutines.flow.onStart
@@ -204,7 +204,8 @@ class ChatNewMessageViewModel :
var uploadsWaitingToBeSent by mutableStateOf<List<SuccessfulUploads>>(emptyList())
override var message by mutableStateOf(TextFieldValue(""))
override val messageState = TextFieldState()
var message by mutableStateOf(TextFieldValue(""))
val urlPreviews = PreviewState()
@@ -217,7 +218,9 @@ class ChatNewMessageViewModel :
var emojiSuggestions: EmojiSuggestionState? = null
var toUsers by mutableStateOf(TextFieldValue(""))
val toUsersState = TextFieldState()
var subject by mutableStateOf(TextFieldValue(""))
val subjectState = TextFieldState()
// Invoices
var canAddInvoice by mutableStateOf(false)
@@ -229,6 +232,7 @@ class ChatNewMessageViewModel :
var wantsForwardZapTo by mutableStateOf(false)
override val forwardZapTo = mutableStateOf<SplitBuilder<User>>(SplitBuilder())
override val forwardZapToEditting = mutableStateOf(TextFieldValue(""))
override val forwardZapToEdittingState = TextFieldState()
// NSFW, Sensitive
var wantsToMarkAsSensitive by mutableStateOf(false)
@@ -671,7 +675,7 @@ class ChatNewMessageViewModel :
updateMessage(TextFieldValue(message.text + " " + it))
}
override fun updateMessage(newMessage: TextFieldValue) {
fun updateMessage(newMessage: TextFieldValue) {
message = newMessage
urlPreviews.update(newMessage)
@@ -21,6 +21,7 @@
package com.vitorpamplona.amethyst.ui.screen.loggedIn.home
import android.content.Context
import androidx.compose.foundation.text.input.TextFieldState
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableLongStateOf
@@ -183,7 +184,8 @@ open class ShortNotePostViewModel :
val iMetaAttachments = IMetaAttachments()
var nip95attachments by mutableStateOf<List<Pair<FileStorageEvent, FileStorageHeaderEvent>>>(emptyList())
override var message by mutableStateOf(TextFieldValue(""))
override val messageState = TextFieldState()
var message by mutableStateOf(TextFieldValue(""))
val urlPreviews = PreviewState()
@@ -266,6 +268,7 @@ open class ShortNotePostViewModel :
var wantsForwardZapTo by mutableStateOf(false)
override var forwardZapTo = mutableStateOf<SplitBuilder<User>>(SplitBuilder())
override var forwardZapToEditting = mutableStateOf(TextFieldValue(""))
override val forwardZapToEdittingState = TextFieldState()
// NSFW, Sensitive
var wantsToMarkAsSensitive by mutableStateOf(false)
@@ -1107,7 +1110,7 @@ open class ShortNotePostViewModel :
updateMessage(TextFieldValue(message.text + " " + it))
}
override fun updateMessage(newMessage: TextFieldValue) {
open fun updateMessage(newMessage: TextFieldValue) {
message = newMessage
urlPreviews.update(message)