Fix threading issue with scheduled message

This commit is contained in:
Naveen 2022-11-03 22:41:41 +05:30
parent 9fb37320d4
commit c1ccfd343b
1 changed files with 9 additions and 6 deletions

View File

@ -1013,13 +1013,16 @@ class ThreadActivity : SimpleActivity() {
conversationsDB.insertOrUpdate(conversation.copy(date = nowSeconds)) conversationsDB.insertOrUpdate(conversation.copy(date = nowSeconds))
} }
scheduleMessage(message) scheduleMessage(message)
}
clearCurrentMessage()
hideScheduleSendUi()
scheduledMessage = null
if (!refreshedSinceSent) { runOnUiThread {
refreshMessages() clearCurrentMessage()
hideScheduleSendUi()
scheduledMessage = null
if (!refreshedSinceSent) {
refreshMessages()
}
}
} }
} catch (e: Exception) { } catch (e: Exception) {
showErrorToast(e.localizedMessage ?: getString(R.string.unknown_error_occurred)) showErrorToast(e.localizedMessage ?: getString(R.string.unknown_error_occurred))