Merge pull request #518 from Inhishonor/fix-draft

Fix draft being sorted at the bottom
This commit is contained in:
octoshrimpy
2025-08-29 11:15:45 -04:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
@@ -36,7 +36,7 @@ class QkRealmMigration @Inject constructor(
) : RealmMigration {
companion object {
const val SchemaVersion: Long = 12
const val SchemaVersion: Long = 13
}
@SuppressLint("ApplySharedPref")
@@ -249,6 +249,12 @@ class QkRealmMigration @Inject constructor(
version++
}
if (version == 12L) {
realm.schema.get("Conversation")
?.addField("draftDate", Long::class.java, FieldAttribute.REQUIRED)
version++
}
check(version >= newVersion) { "Migration missing from v$oldVersion to v$newVersion" }
}
@@ -353,6 +353,7 @@ class ConversationRepositoryImpl @Inject constructor(
realm.executeTransaction {
conversation?.takeIf { it.isValid }?.draft = draft
conversation?.takeIf { it.isValid }?.draftDate = System.currentTimeMillis()
}
}