Skip to content

Commit 2d5a2ad

Browse files
CypherPoetCypherPoet
authored andcommitted
refactor: skip reevaluate() timer when a sheet is open
reevaluate() now bails when a sheet is already showing, mirroring the guard in checkAndShowNextSheet(), so a late update publish no longer arms a settle timer that would only no-op. Addresses review on #601.
1 parent e3ecb17 commit 2d5a2ad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Bitkit/Managers/TimedSheets/TimedSheetManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ class TimedSheetManager: ObservableObject {
112112

113113
/// Re-check the timed-sheet queue after async state changes that may have made a sheet newly
114114
/// eligible (for example, the app-update info arriving after the initial settle check). No-ops
115-
/// unless currently on a primary screen.
115+
/// unless on a primary screen with no sheet already open.
116116
func reevaluate() {
117-
guard isOnPrimaryScreen else { return }
117+
guard isOnPrimaryScreen, !(sheetViewModel?.isAnySheetOpen ?? false) else { return }
118118
Logger.debug("Re-evaluating timed sheets after external state change")
119119
scheduleSettleCheck()
120120
}

0 commit comments

Comments
 (0)