Skip to content

Commit

Permalink
Fix model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
milanvarady committed Jan 11, 2025
1 parent 203b53e commit 4247a6f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ extension CaskManager {
}

struct CompiledCaskViewModels {
var allCasksList: [Cask] = []
var allCasksDict: [CaskId: Cask] = [:]
var installedCasks: [Cask] = []
var categoryDict: [CategoryId: [Cask]] = [:]
Expand Down Expand Up @@ -256,6 +257,7 @@ extension CaskManager {

// Store casks from chunk
for (id, cask) in chunkCasks {
viewModels.allCasksList.append(cask)
viewModels.allCasksDict[id] = cask

if cask.isInstalled {
Expand Down Expand Up @@ -303,6 +305,7 @@ extension CaskManager {
)

self.casks = caskViewModels.allCasksDict
self.allCasks.defineCasks(caskViewModels.allCasksList)
self.installedCasks.defineCasks(caskViewModels.installedCasks.sorted())

// Make category view models
Expand Down

0 comments on commit 4247a6f

Please sign in to comment.