Skip to content

Commit d904dff

Browse files
committed
fix ui issue with requiredinstalldate under hour and no quit button set
1 parent fcf7b18 commit d904dff

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Requires macOS 12.0 and higher. Further releases and feature requests may make t
4040
- Refactor portions of the `softwareupdate` logic to reduce potential errors
4141
- Fixed errors when moving to Swift 5.10
4242
- Fixed wrong `requiredInstallationDate` calculations when using [Non-Gregorian calendars](https://github.com/macadmins/nudge/issues/509)
43+
- Fixed UI logic when requiredInstallationDate is under an hour and `allowLaterDeferralButton` is set to false
44+
- Issue [475](https://github.com/macadmins/nudge/issues/475)
4345

4446
### Added
4547
- To artificially change the `requredInstallationDate` thereby giving your users a default grace period for all Nudge events updates, please configure the `nudgeEventLaunchDelay` key under `userExperience`

Nudge/UI/Common/QuitButtons.swift

+16-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ struct QuitButtons: View {
1414
var body: some View {
1515
HStack {
1616
if shouldShowSecondaryQuitButton {
17-
secondaryQuitButton
18-
.frame(maxWidth:215, maxHeight: 30)
17+
if UserExperienceVariables.allowLaterDeferralButton {
18+
secondaryQuitButton
19+
.frame(maxWidth:215, maxHeight: 30)
20+
} else {
21+
if appState.secondsRemaining > 3600 {
22+
secondaryQuitButton
23+
.frame(maxWidth:215, maxHeight: 30)
24+
}
25+
}
1926
Spacer()
2027
}
2128
if shouldShowPrimaryQuitButton {
@@ -76,7 +83,13 @@ struct QuitButtons: View {
7683
private var primaryQuitButton: some View {
7784
Group {
7885
if UserExperienceVariables.allowUserQuitDeferrals {
79-
deferralMenu
86+
if UserExperienceVariables.allowLaterDeferralButton {
87+
deferralMenu
88+
} else {
89+
if appState.secondsRemaining > 3600 {
90+
deferralMenu
91+
}
92+
}
8093
} else {
8194
standardQuitButton
8295
}

0 commit comments

Comments
 (0)