mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-23 20:55:02 +01:00
fix bug cause im an idiot
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
parent
71bd381828
commit
af65208a6c
@ -113,7 +113,7 @@ class ChatViewModel @Inject constructor(
|
||||
chatRepository.handleOnPause()
|
||||
mediaPlayerManager.handleOnPause()
|
||||
|
||||
runBlocking {
|
||||
runBlocking(Dispatchers.IO) {
|
||||
val model = conversationRepository.getLocallyStoredConversation(chatRoomToken)
|
||||
model?.let {
|
||||
it.messageDraft = messageDraft
|
||||
@ -903,7 +903,9 @@ class ChatViewModel @Inject constructor(
|
||||
|
||||
suspend fun updateMessageDraft() {
|
||||
val model = conversationRepository.getLocallyStoredConversation(chatRoomToken)
|
||||
messageDraft = model?.messageDraft!!
|
||||
model?.messageDraft?.let {
|
||||
messageDraft = it
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -29,9 +29,6 @@ interface ConversationsDao {
|
||||
@Upsert()
|
||||
fun upsertConversations(conversationEntities: List<ConversationEntity>)
|
||||
|
||||
@Insert(onConflict = REPLACE)
|
||||
suspend fun insertOrUpdate(item: ConversationEntity)
|
||||
|
||||
@Transaction
|
||||
suspend fun upsertConversations(accountId: Long, serverItems: List<ConversationEntity>) {
|
||||
serverItems.forEach { serverItem ->
|
||||
@ -39,10 +36,9 @@ interface ConversationsDao {
|
||||
if (existingItem != null) {
|
||||
val mergedItem = serverItem
|
||||
mergedItem.messageDraft = existingItem.messageDraft
|
||||
insertOrUpdate(mergedItem)
|
||||
updateConversation(mergedItem)
|
||||
} else {
|
||||
// Insert new item directly (local-only fields will be default)
|
||||
insertOrUpdate(serverItem)
|
||||
insertConversation(serverItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -61,6 +57,9 @@ interface ConversationsDao {
|
||||
@Update(onConflict = REPLACE)
|
||||
fun updateConversation(conversationEntity: ConversationEntity)
|
||||
|
||||
@Insert(onConflict = REPLACE)
|
||||
fun insertConversation(conversation: ConversationEntity)
|
||||
|
||||
@Query(
|
||||
"""
|
||||
DELETE FROM Conversations
|
||||
|
@ -194,14 +194,12 @@ class DummyConversationDaoImpl : ConversationsDao {
|
||||
|
||||
override fun upsertConversations(conversationEntities: List<ConversationEntity>) { /* */ }
|
||||
|
||||
override suspend fun insertOrUpdate(item: ConversationEntity) {
|
||||
/**/
|
||||
}
|
||||
|
||||
override fun deleteConversations(conversationIds: List<String>) { /* */ }
|
||||
|
||||
override fun updateConversation(conversationEntity: ConversationEntity) { /* */ }
|
||||
|
||||
override fun insertConversation(conversation: ConversationEntity) { /* */ }
|
||||
|
||||
override fun clearAllConversationsForUser(accountId: Long) { /* */ }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user