From c67f5f61a7b0feff791a36e572765ed6c5d653ff Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Tue, 1 Dec 2020 14:02:55 +1100 Subject: [PATCH] Fix loader not disappearing --- SessionMessagingKit/Jobs/AttachmentUploadJob.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SessionMessagingKit/Jobs/AttachmentUploadJob.swift b/SessionMessagingKit/Jobs/AttachmentUploadJob.swift index f0f2f37aa..bc2285d23 100644 --- a/SessionMessagingKit/Jobs/AttachmentUploadJob.swift +++ b/SessionMessagingKit/Jobs/AttachmentUploadJob.swift @@ -81,6 +81,14 @@ public final class AttachmentUploadJob : NSObject, Job, NSCoding { // NSObject/N SNLog("Attachment uploaded successfully.") delegate?.handleJobSucceeded(self) Configuration.shared.storage.resumeMessageSendJobIfNeeded(messageSendJobID) + Storage.shared.withAsync({ transaction in + var interaction: TSInteraction? + let transaction = transaction as! YapDatabaseReadWriteTransaction + TSDatabaseSecondaryIndexes.enumerateMessages(withTimestamp: self.message.sentTimestamp!, with: { _, key, _ in + interaction = TSInteraction.fetch(uniqueId: key, transaction: transaction) + }, using: transaction) + interaction?.touch(with: transaction) // To refresh the associated message cell and hide the loader + }, completion: { }) } private func handlePermanentFailure(error: Swift.Error) {