Skip to content

Commit 34fcb04

Browse files
ariedovmahibi
authored andcommitted
fix: using scope.launch to unblock polling
Signed-off-by: David Leibovych <ariedov@gmail.com>
1 parent cc53059 commit 34fcb04

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,25 @@ class OfflineFirstChatRepository @Inject constructor(
239239
}
240240
}
241241

242-
private suspend fun handleUploadsFromDb() {
243-
fileUploadsDao.getFileUploadsForConversation(internalConversationId)
244-
.onEach {
245-
_uploadsFlow.emit(
246-
it.map { item ->
247-
FileUploadModel(
248-
id = item.id,
249-
fileName = item.fileName,
250-
progress = item.progress
251-
)
252-
}
253-
)
254-
}
255-
.catch {
256-
Log.e(TAG, "Failed reading uploads")
257-
}
258-
.collect()
242+
private fun handleUploadsFromDb() {
243+
scope.launch {
244+
fileUploadsDao.getFileUploadsForConversation(internalConversationId)
245+
.onEach {
246+
_uploadsFlow.emit(
247+
it.map { item ->
248+
FileUploadModel(
249+
id = item.id,
250+
fileName = item.fileName,
251+
progress = item.progress
252+
)
253+
}
254+
)
255+
}
256+
.catch {
257+
Log.e(TAG, "Failed reading uploads")
258+
}
259+
.collect()
260+
}
259261
}
260262

261263
private suspend fun getCappedMessagesAmountOfChatBlock(messageId: Long): Int {

0 commit comments

Comments
 (0)