You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case no previous entry is currently presented, display the new entry.
In case there is an entry that is currently presented - Compare their priorities:
(1) When new entry's priority is greater than old, present it and enqueue the old entry, the old entry will present just after the new entry is dismissed.
(2) Otherwise, enqueue the new entry, an present it just after the previous one is dismissed.
Like:
case let .enqueue(curPriority):
if !isCurrentlyDisplaying() {
show(entryView: entryView, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow)
return
}
if let prev = isCurrentlyEntryView() {
var prevPriority: EKAttributes.Precedence.Priority = .normal
switch prev.attributes.precedence {
case let .override(priority, _):
prevPriority = priority
case let .enqueue(priority):
prevPriority = priority
}
if curPriority >= prevPriority {
show(entryView: entryView, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow)
entryQueue.enqueue(entry: .init(view: prev, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow))
} else {
entryQueue.enqueue(entry: .init(view: entryView, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow))
}
}
}
The text was updated successfully, but these errors were encountered:
(1) When new entry's priority is greater than old, present it and enqueue the old entry, the old entry will present just after the new entry is dismissed.
(2) Otherwise, enqueue the new entry, an present it just after the previous one is dismissed.
Like:
case let .enqueue(curPriority):
if !isCurrentlyDisplaying() {
show(entryView: entryView, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow)
return
}
if let prev = isCurrentlyEntryView() {
var prevPriority: EKAttributes.Precedence.Priority = .normal
switch prev.attributes.precedence {
case let .override(priority, _):
prevPriority = priority
case let .enqueue(priority):
prevPriority = priority
}
if curPriority >= prevPriority {
show(entryView: entryView, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow)
entryQueue.enqueue(entry: .init(view: prev, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow))
} else {
entryQueue.enqueue(entry: .init(view: entryView, presentInsideKeyWindow: presentInsideKeyWindow, rollbackWindow: rollbackWindow))
}
}
}
The text was updated successfully, but these errors were encountered: