Skip to content

Commit

Permalink
sort listCGM
Browse files Browse the repository at this point in the history
  • Loading branch information
mountrcg committed May 19, 2024
1 parent 8b3f387 commit 93b4598
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions FreeAPS/Sources/Modules/CGM/CGMStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ extension CGM {
cgmName(id: $0.identifier, type: CGMType.plugin, displayName: $0.localizedTitle, subtitle: $0.localizedTitle)
}

listOfCGM.sort {
if $0.type == .none {
return true
} else if $1.type == .none {
return false
} else {
return $0.displayName < $1.displayName
}
}

switch settingsManager.settings.cgm {
case .plugin:
if let cgmPluginInfo = listOfCGM.first(where: { $0.id == settingsManager.settings.cgmPluginIdentifier }) {
Expand Down

0 comments on commit 93b4598

Please sign in to comment.