Fix loader not disappearing

This commit is contained in:
nielsandriesse 2020-12-01 14:02:55 +11:00
parent a87bad6603
commit c67f5f61a7
1 changed files with 8 additions and 0 deletions

View File

@ -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) {