Save draft when redrafting a post (#1744)
This commit is contained in:
parent
26a051220b
commit
e237639adc
4 changed files with 8 additions and 4 deletions
|
|
@ -1008,7 +1008,8 @@ class ComposeActivity : BaseActivity(),
|
|||
var mediaAttachments: List<Attachment>? = null,
|
||||
var scheduledAt: String? = null,
|
||||
var sensitive: Boolean? = null,
|
||||
var poll: NewPoll? = null
|
||||
var poll: NewPoll? = null,
|
||||
var modifiedInitialState: Boolean? = null
|
||||
) : Parcelable
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ class ComposeViewModel
|
|||
private var startingVisibility: Status.Visibility = Status.Visibility.UNKNOWN
|
||||
|
||||
private var contentWarningStateChanged: Boolean = false
|
||||
private var modifiedInitialState: Boolean = false
|
||||
|
||||
private val instance: MutableLiveData<InstanceEntity?> = MutableLiveData(null)
|
||||
|
||||
|
|
@ -197,7 +198,7 @@ class ComposeViewModel
|
|||
val mediaChanged = !media.value.isNullOrEmpty()
|
||||
val pollChanged = poll.value != null
|
||||
|
||||
return textChanged || contentWarningChanged || mediaChanged || pollChanged
|
||||
return modifiedInitialState || textChanged || contentWarningChanged || mediaChanged || pollChanged
|
||||
}
|
||||
|
||||
fun contentWarningChanged(value: Boolean) {
|
||||
|
|
@ -369,7 +370,7 @@ class ComposeViewModel
|
|||
preferredVisibility.num.coerceAtLeast(replyVisibility.num))
|
||||
|
||||
inReplyToId = composeOptions?.inReplyToId
|
||||
|
||||
modifiedInitialState = composeOptions?.modifiedInitialState == true
|
||||
|
||||
val contentWarning = composeOptions?.contentWarning
|
||||
if (contentWarning != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue