Save draft when redrafting a post (#1744)
This commit is contained in:
parent
26a051220b
commit
e237639adc
|
@ -178,7 +178,8 @@ public final class SavedTootActivity extends BaseActivity implements SavedTootAd
|
|||
/*mediaAttachments*/null,
|
||||
/*scheduledAt*/null,
|
||||
/*sensitive*/null,
|
||||
/*poll*/null
|
||||
/*poll*/null,
|
||||
/* modifiedInitialState */ true
|
||||
);
|
||||
Intent intent = ComposeActivity.startIntent(this, composeOptions);
|
||||
startActivity(intent);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -457,6 +457,7 @@ public abstract class SFragment extends BaseFragment implements Injectable {
|
|||
composeOptions.setContentWarning(deletedStatus.getSpoilerText());
|
||||
composeOptions.setMediaAttachments(deletedStatus.getAttachments());
|
||||
composeOptions.setSensitive(deletedStatus.getSensitive());
|
||||
composeOptions.setModifiedInitialState(true);
|
||||
if (deletedStatus.getPoll() != null) {
|
||||
composeOptions.setPoll(deletedStatus.getPoll().toNewPoll(deletedStatus.getCreatedAt()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue