Skip to content

Commit

Permalink
Remove unnecessary all_ group sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Jan 17, 2020
1 parent 310cf6e commit e0eb284
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions HA Menu/MenuItemController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,8 @@ final class MenuItemController: NSObject, NSMenuDelegate {
}
}

// If a default group then sort, otherwise reverse
if (groupId.starts(with: "all_")) {
entities = entities.sorted(by: {$0.friendlyName > $1.friendlyName})
}
else {
entities = entities.reversed()
}

entities = entities.reversed()

self.addEntitiesToMenu(entities: entities)
} else {
self.addErrorMenuItem(message: "Group \(groupId) not found")
Expand Down

0 comments on commit e0eb284

Please sign in to comment.