Skip to content

Commit

Permalink
Merge pull request #17 from sergeykhliustin/update/build_list_perform…
Browse files Browse the repository at this point in the history
…ance

Fixed build list performance issue
  • Loading branch information
sergeykhliustin authored Jan 24, 2023
2 parents 961a9ab + c054c88 commit d313731
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ public final class ViewModelFactory {
}

public func build(_ build: BuildResponseItemModel) -> BuildViewModel {
// TODO: Double check
let model = cached(key: "BuildViewModel_\(build.slug)", model: BuildViewModel(tokenManager, build: build))
if build.status != .running {
model.value = build
if build.status == .running {
return cached(key: "BuildViewModel_\(build.slug)", model: BuildViewModel(tokenManager, build: build))
} else {
return BuildViewModel(tokenManager, build: build)
}
return model
}

public func logs(_ build: BuildResponseItemModel) -> LogsViewModel {
Expand Down

0 comments on commit d313731

Please sign in to comment.