From 0038a78df3fce6b1d8e0c35a5ef8db99fc4fe441 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Thu, 23 Nov 2023 13:46:42 +1100 Subject: [PATCH] fix outdated client banner --- Session/Conversations/ConversationVC.swift | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 10251b6d6..784752ff3 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -1522,7 +1522,17 @@ final class ConversationVC: BaseVC, SessionUtilRespondingViewController, Convers } guard let outdatedMemberId: String = outdatedMemberId else { - removeOutdatedClientBanner() + UIView.animate( + withDuration: 0.25, + animations: { [weak self] in + self?.outdatedClientBanner.alpha = 0 + }, + completion: { [weak self] _ in + self?.outdatedClientBanner.isHidden = true + self?.outdatedClientBanner.alpha = 1 + self?.emptyStateLabelTopConstraint?.constant = Values.largeSpacing + } + ) return } @@ -1539,17 +1549,12 @@ final class ConversationVC: BaseVC, SessionUtilRespondingViewController, Convers } private func removeOutdatedClientBanner() { - UIView.animate( - withDuration: 0.25, - animations: { [weak self] in - self?.outdatedClientBanner.alpha = 0 - }, - completion: { [weak self] _ in - self?.outdatedClientBanner.isHidden = true - self?.outdatedClientBanner.alpha = 1 - self?.emptyStateLabelTopConstraint?.constant = Values.largeSpacing - } - ) + guard let outdatedMemberId: String = self.viewModel.threadData.outdatedMemberId else { return } + Storage.shared.writeAsync { db in + try Contact + .filter(id: outdatedMemberId) + .updateAll(db, Contact.Columns.lastKnownClientVersion.set(to: nil)) + } } func addOrRemoveBlockedBanner(threadIsBlocked: Bool) {