Skip to content

Commit

Permalink
fix xcode 14.2 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Dec 29, 2022
1 parent 6b36a7d commit 6ed9272
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Nudge/UI/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ class ViewState: ObservableObject {
@Published var hasClickedSecondaryQuitButton = false
@Published var hasLoggedDeferralCountPastThreshhold = false
@Published var hasLoggedDeferralCountPastThresholdDualQuitButtons = false
@Published var hasLoggedMajorOSVersion = false
@Published var hasLoggedMajorRequiredOSVersion = false
@Published var hasLoggedPastRequiredInstallationDate = false
@Published var hasLoggedRequireDualQuitButtons = false
@Published var hasLoggedRequireMajorUgprade = false
@Published var hoursRemaining = Utils().getNumberOfHoursRemaining()
@Published var lastRefreshTime = Utils().getFormattedDate()
@Published var requireDualQuitButtons = false
Expand All @@ -44,6 +41,9 @@ class LogState {
var afterFirstRun = false
var hasLoggedBundleMode = false
var hasLoggedDemoMode = false
var hasLoggedMajorOSVersion = false
var hasLoggedMajorRequiredOSVersion = false
var hasLoggedRequireMajorUgprade = false
var hasLoggedScreenshotIconMode = false
var hasLoggedSimpleMode = false
var hasLoggedUnitTestingMode = false
Expand Down
12 changes: 6 additions & 6 deletions Nudge/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ struct Utils {

func getMajorOSVersion() -> Int {
let MajorOSVersion = ProcessInfo().operatingSystemVersion.majorVersion
if !nudgePrimaryState.hasLoggedMajorOSVersion {
nudgePrimaryState.hasLoggedMajorOSVersion = true
if !nudgeLogState.hasLoggedMajorOSVersion {
nudgeLogState.hasLoggedMajorOSVersion = true
utilsLog.info("OS Version: \(MajorOSVersion, privacy: .public)")
}
return MajorOSVersion
Expand All @@ -486,8 +486,8 @@ struct Utils {
func getMajorRequiredNudgeOSVersion() -> Int {
let parts = requiredMinimumOSVersion.split(separator: ".", omittingEmptySubsequences: false)
let majorRequiredNudgeOSVersion = Int((parts[0]))!
if !nudgePrimaryState.hasLoggedMajorRequiredOSVersion {
nudgePrimaryState.hasLoggedMajorRequiredOSVersion = true
if !nudgeLogState.hasLoggedMajorRequiredOSVersion {
nudgeLogState.hasLoggedMajorRequiredOSVersion = true
utilsLog.info("Major required OS version: \(majorRequiredNudgeOSVersion, privacy: .public)")
}
return majorRequiredNudgeOSVersion
Expand Down Expand Up @@ -812,8 +812,8 @@ struct Utils {

func requireMajorUpgrade() -> Bool {
let requireMajorUpdate = versionGreaterThan(currentVersion: String(getMajorRequiredNudgeOSVersion()), newVersion: String(getMajorOSVersion()))
if !nudgePrimaryState.hasLoggedRequireMajorUgprade {
nudgePrimaryState.hasLoggedRequireMajorUgprade = true
if !nudgeLogState.hasLoggedRequireMajorUgprade {
nudgeLogState.hasLoggedRequireMajorUgprade = true
utilsLog.info("Device requireMajorUpgrade: \(requireMajorUpdate, privacy: .public)")
}
return requireMajorUpdate
Expand Down

0 comments on commit 6ed9272

Please sign in to comment.