From afe08faa4a40f9150b4118f7c7f040b5b4462843 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Fri, 23 Feb 2024 17:32:20 +1100 Subject: [PATCH] move disappearing message jobs to its concurrent queue. --- .../Conversations/Context Menu/ContextMenuVC+ActionView.swift | 3 ++- SessionUtilitiesKit/JobRunner/JobRunner.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/Context Menu/ContextMenuVC+ActionView.swift b/Session/Conversations/Context Menu/ContextMenuVC+ActionView.swift index 8c3c38dfc..f4ae38657 100644 --- a/Session/Conversations/Context Menu/ContextMenuVC+ActionView.swift +++ b/Session/Conversations/Context Menu/ContextMenuVC+ActionView.swift @@ -118,7 +118,8 @@ extension ContextMenuVC { subtitleLabel.isHidden = false subtitleWidthConstraint.isActive = true - let timeToExpireInSeconds: TimeInterval = (expiresStartedAtMs + expiresInSeconds * 1000 - Double(SnodeAPI.currentOffsetTimestampMs())) / 1000 + // To prevent a negative timer + let timeToExpireInSeconds: TimeInterval = max(0, (expiresStartedAtMs + expiresInSeconds * 1000 - Double(SnodeAPI.currentOffsetTimestampMs())) / 1000) subtitleLabel.text = String(format: "DISAPPEARING_MESSAGES_AUTO_DELETES_COUNT_DOWN".localized(), timeToExpireInSeconds.formatted(format: .twoUnits)) timer = Timer.scheduledTimerOnMainThread(withTimeInterval: 1, repeats: true, block: { [weak self] _ in diff --git a/SessionUtilitiesKit/JobRunner/JobRunner.swift b/SessionUtilitiesKit/JobRunner/JobRunner.swift index 3204e296d..290439165 100644 --- a/SessionUtilitiesKit/JobRunner/JobRunner.swift +++ b/SessionUtilitiesKit/JobRunner/JobRunner.swift @@ -262,7 +262,8 @@ public final class JobRunner: JobRunnerType { isTestingJobRunner: isTestingJobRunner, jobVariants: [ jobVariants.remove(.expirationUpdate), - jobVariants.remove(.getExpiration) + jobVariants.remove(.getExpiration), + jobVariants.remove(.disappearingMessages) ].compactMap { $0 } ),