mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Fix thread update with drafts bugs.
* Fix thread not updating correctly when drafts are present. * Fix thread delete bug during first message drafting.
This commit is contained in:
@@ -48,8 +48,8 @@ class DraftRepository(
|
||||
draftDatabase.replaceDrafts(actualThreadId, drafts)
|
||||
threadDatabase.updateSnippet(actualThreadId, drafts.getSnippet(context), drafts.uriSnippet, System.currentTimeMillis(), MmsSmsColumns.Types.BASE_DRAFT_TYPE, true)
|
||||
} else if (threadId > 0) {
|
||||
threadDatabase.update(threadId, false)
|
||||
draftDatabase.clearDrafts(threadId)
|
||||
threadDatabase.update(threadId, unarchive = false, allowDeletion = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class DraftViewModel @JvmOverloads constructor(
|
||||
return repository
|
||||
.loadDrafts(threadId)
|
||||
.doOnSuccess { drafts ->
|
||||
store.update { it.copyAndSetDrafts(threadId, drafts.drafts) }
|
||||
store.update { saveDrafts(it.copyAndSetDrafts(threadId, drafts.drafts)) }
|
||||
}
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user