create a loadFromDraft method
This commit is contained in:
@@ -185,6 +185,7 @@ fun NewPostView(
|
||||
quote: Note? = null,
|
||||
fork: Note? = null,
|
||||
version: Note? = null,
|
||||
draft: Note? = null,
|
||||
enableMessageInterface: Boolean = false,
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: (String) -> Unit,
|
||||
@@ -201,7 +202,7 @@ fun NewPostView(
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
launch(Dispatchers.IO) {
|
||||
postViewModel.load(accountViewModel, baseReplyTo, quote, fork, version)
|
||||
postViewModel.load(accountViewModel, baseReplyTo, quote, fork, version, draft)
|
||||
|
||||
postViewModel.imageUploadingError.collect { error ->
|
||||
withContext(Dispatchers.Main) { Toast.makeText(context, error, Toast.LENGTH_SHORT).show() }
|
||||
|
||||
@@ -184,10 +184,14 @@ open class NewPostViewModel() : ViewModel() {
|
||||
quote: Note?,
|
||||
fork: Note?,
|
||||
version: Note?,
|
||||
draft: Note?,
|
||||
) {
|
||||
this.accountViewModel = accountViewModel
|
||||
this.account = accountViewModel.account
|
||||
|
||||
if (draft != null) {
|
||||
loadfromDraft(draft)
|
||||
} else {
|
||||
originalNote = replyingTo
|
||||
replyingTo?.let { replyNote ->
|
||||
if (replyNote.event is BaseTextNoteEvent) {
|
||||
@@ -299,6 +303,11 @@ open class NewPostViewModel() : ViewModel() {
|
||||
wantsForwardZapTo = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadfromDraft(draft: Note?) {
|
||||
// TODO: finish the loadfromDraft method
|
||||
}
|
||||
|
||||
fun sendPost(
|
||||
relayList: List<Relay>? = null,
|
||||
|
||||
Reference in New Issue
Block a user