Skip to content

Commit ac58141

Browse files
Fix incorrect beta notifications when on latest beta
1 parent e12a008 commit ac58141

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

HA Menu/MenuItemController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,19 +479,22 @@ final class MenuItemController: NSObject, NSMenuDelegate {
479479

480480
if let latestId = (feed.atomFeed?.entries?.first?.id!) {
481481
let idArray = latestId.components(separatedBy: "/")
482-
let latestVersion = idArray.last
482+
var latestVersion = idArray.last
483483

484484
// Do nothing with final builds, they are pulled manually when required
485485
if (latestVersion?.hasSuffix("final"))! {
486486
return
487487
}
488488

489+
// If the version has suffix of beta, strip suffix for later comparison and flag as beta
489490
var beta = false
490491
if (latestVersion?.hasSuffix("beta"))! {
491492
beta = true
492493
if (!self.prefs.betaNotifications) {
493494
return
494495
}
496+
497+
latestVersion = String(latestVersion!.dropLast(4))
495498
}
496499

497500
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String

0 commit comments

Comments
 (0)