Skip to content

Commit

Permalink
fix: fixes an issue with multiple timers being scheduled (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardGatt committed Feb 15, 2024
1 parent 114b31b commit ec383f1
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -3,11 +3,14 @@ import UIKit

class MessageQueueManager {
var interval: Double = 600
private var queueTimer: Timer!
private var queueTimer: Timer?
// The local message store is used to keep messages that can't be displayed because the route rule doesnt match.
private var localMessageStore: [String: Message] = [:]

func setup(skipQueueCheck: Bool = false) {
queueTimer?.invalidate()
queueTimer = nil

queueTimer = Timer.scheduledTimer(
timeInterval: interval,
target: self,
Expand Down

0 comments on commit ec383f1

Please sign in to comment.