fix(core/notifications): resume coroutine

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk 2025-01-03 01:08:56 +01:00
parent f69f08c4ed
commit a1dc03c958

View File

@ -486,13 +486,12 @@ class Notifications : Feature("Notifications") {
context.coroutineScope.launch(coroutineDispatcher) { context.coroutineScope.launch(coroutineDispatcher) {
suspendCoroutine { continuation -> suspendCoroutine { continuation ->
conversationManager.fetchMessageByServerId(conversationId, serverMessageId.toLong(), onSuccess = { conversationManager.fetchMessageByServerId(conversationId, serverMessageId.toLong(), onSuccess = {
continuation.resumeWith(Result.success(Unit))
if (it.senderId.toString() == context.database.myUserId) { if (it.senderId.toString() == context.database.myUserId) {
continuation.resumeWith(Result.success(Unit))
param.invokeOriginal() param.invokeOriginal()
return@fetchMessageByServerId return@fetchMessageByServerId
} }
context.coroutineScope.launch(coroutineDispatcher) { context.coroutineScope.launch(coroutineDispatcher) {
continuation.resumeWith(Result.success(Unit))
onMessageReceived(notificationData, notificationType, it) onMessageReceived(notificationData, notificationType, it)
} }
}, onError = { }, onError = {