From 8fe285022971d83cfa678b26f0972a62b13ceccc Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Sun, 20 Oct 2024 20:48:53 +0200 Subject: [PATCH] fix: Don't prompt to discard/save unedited scheduled posts (#1034) Previous code didn't send the language to ComposeActivity when editing a scheduled status so it always appeared to be dirty. This prompted the user to save/discard changes when backing out, even if they hadn't made any changes. Fix this by collecting the language code when fetching scheduled posts and passing it in `ComposeOptions`. --- .../app/pachli/components/scheduled/ScheduledStatusActivity.kt | 1 + .../main/kotlin/app/pachli/core/network/model/StatusParams.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/java/app/pachli/components/scheduled/ScheduledStatusActivity.kt b/app/src/main/java/app/pachli/components/scheduled/ScheduledStatusActivity.kt index 857f69b41..3989cd117 100644 --- a/app/src/main/java/app/pachli/components/scheduled/ScheduledStatusActivity.kt +++ b/app/src/main/java/app/pachli/components/scheduled/ScheduledStatusActivity.kt @@ -166,6 +166,7 @@ class ScheduledStatusActivity : sensitive = item.params.sensitive, kind = ComposeOptions.ComposeKind.EDIT_SCHEDULED, poll = item.params.poll, + language = item.params.language, ), ) startActivity(intent) diff --git a/core/network/src/main/kotlin/app/pachli/core/network/model/StatusParams.kt b/core/network/src/main/kotlin/app/pachli/core/network/model/StatusParams.kt index 52cad76a2..9c420ad98 100644 --- a/core/network/src/main/kotlin/app/pachli/core/network/model/StatusParams.kt +++ b/core/network/src/main/kotlin/app/pachli/core/network/model/StatusParams.kt @@ -28,4 +28,5 @@ data class StatusParams( @Json(name = "spoiler_text") val spoilerText: String, @Json(name = "in_reply_to_id") val inReplyToId: String?, val poll: NewPoll?, + val language: String? = null, )