mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-29 22:45:18 -04:00
SwiftFormat preferKeyPath
This commit is contained in:
parent
dac5248962
commit
c75d1007ee
7 changed files with 11 additions and 11 deletions
|
@ -16,7 +16,7 @@ class TaskManager: ObservableObject {
|
||||||
var task: Task<Any, Error> = Task {}
|
var task: Task<Any, Error> = Task {}
|
||||||
|
|
||||||
var currentState: MistTaskState {
|
var currentState: MistTaskState {
|
||||||
let states: Set<MistTaskState> = Set(taskGroups.flatMap { $0.tasks }.map { $0.state })
|
let states: Set<MistTaskState> = Set(taskGroups.flatMap(\.tasks).map(\.state))
|
||||||
|
|
||||||
if states.contains(.inProgress) {
|
if states.contains(.inProgress) {
|
||||||
return .inProgress
|
return .inProgress
|
||||||
|
|
|
@ -750,7 +750,7 @@ struct Installer: Decodable, Hashable, Identifiable {
|
||||||
"date": date,
|
"date": date,
|
||||||
"compatible": compatible,
|
"compatible": compatible,
|
||||||
"distribution": distributionURL,
|
"distribution": distributionURL,
|
||||||
"packages": packages.map { $0.dictionary },
|
"packages": packages.map(\.dictionary),
|
||||||
"beta": beta
|
"beta": beta
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -780,7 +780,7 @@ struct Installer: Decodable, Hashable, Identifiable {
|
||||||
}
|
}
|
||||||
|
|
||||||
var size: UInt64 {
|
var size: UInt64 {
|
||||||
UInt64(packages.map { $0.size }.reduce(0, +))
|
UInt64(packages.map(\.size).reduce(0, +))
|
||||||
}
|
}
|
||||||
|
|
||||||
var diskImageSize: Double {
|
var diskImageSize: Double {
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct ActivityView: View {
|
||||||
private let width: CGFloat = 420
|
private let width: CGFloat = 420
|
||||||
private let height: CGFloat = 640
|
private let height: CGFloat = 640
|
||||||
private var bootableInstaller: Bool {
|
private var bootableInstaller: Bool {
|
||||||
taskManager.taskGroups.map { $0.section }.contains(.bootableInstaller)
|
taskManager.taskGroups.map(\.section).contains(.bootableInstaller)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var venturaOrOlder: Bool {
|
private var venturaOrOlder: Bool {
|
||||||
|
|
|
@ -40,7 +40,7 @@ struct ContentView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
if showCompatible {
|
if showCompatible {
|
||||||
filteredFirmwares = filteredFirmwares.filter { $0.compatible }
|
filteredFirmwares = filteredFirmwares.filter(\.compatible)
|
||||||
}
|
}
|
||||||
|
|
||||||
return filteredFirmwares
|
return filteredFirmwares
|
||||||
|
@ -64,7 +64,7 @@ struct ContentView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
if showCompatible {
|
if showCompatible {
|
||||||
filteredInstallers = filteredInstallers.filter { $0.compatible }
|
filteredInstallers = filteredInstallers.filter(\.compatible)
|
||||||
}
|
}
|
||||||
|
|
||||||
return filteredInstallers
|
return filteredInstallers
|
||||||
|
|
|
@ -56,9 +56,9 @@ struct FooterView: View {
|
||||||
|
|
||||||
switch downloadType {
|
switch downloadType {
|
||||||
case .firmware:
|
case .firmware:
|
||||||
dictionaries = firmwares.map { $0.dictionary }
|
dictionaries = firmwares.map(\.dictionary)
|
||||||
case .installer:
|
case .installer:
|
||||||
dictionaries = installers.map { $0.dictionary }
|
dictionaries = installers.map(\.dictionary)
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -172,7 +172,7 @@ struct RefreshView: View {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
installers.append(contentsOf: getInstallers(from: productsDictionary).filter { !installers.map { $0.id }.contains($0.id) })
|
installers.append(contentsOf: getInstallers(from: productsDictionary).filter { !installers.map(\.id).contains($0.id) })
|
||||||
} catch {
|
} catch {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ struct RefreshView: View {
|
||||||
if let array: [[String: Any]] = UserDefaults.standard.array(forKey: "catalogs") as? [[String: Any]] {
|
if let array: [[String: Any]] = UserDefaults.standard.array(forKey: "catalogs") as? [[String: Any]] {
|
||||||
do {
|
do {
|
||||||
catalogs = try JSONDecoder().decode([Catalog].self, from: JSONSerialization.data(withJSONObject: array))
|
catalogs = try JSONDecoder().decode([Catalog].self, from: JSONSerialization.data(withJSONObject: array))
|
||||||
let catalogTypes: [CatalogType] = catalogs.map { $0.type }
|
let catalogTypes: [CatalogType] = catalogs.map(\.type)
|
||||||
|
|
||||||
for catalogType in CatalogType.allCases where !catalogTypes.contains(catalogType) {
|
for catalogType in CatalogType.allCases where !catalogTypes.contains(catalogType) {
|
||||||
let catalog: Catalog = .init(type: catalogType, standard: true, customerSeed: false, developerSeed: false, publicSeed: false)
|
let catalog: Catalog = .init(type: catalogType, standard: true, customerSeed: false, developerSeed: false, publicSeed: false)
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct SettingsInstallersView: View {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
var catalogs: [Catalog] = try JSONDecoder().decode([Catalog].self, from: JSONSerialization.data(withJSONObject: array))
|
var catalogs: [Catalog] = try JSONDecoder().decode([Catalog].self, from: JSONSerialization.data(withJSONObject: array))
|
||||||
let catalogTypes: [CatalogType] = catalogs.map { $0.type }
|
let catalogTypes: [CatalogType] = catalogs.map(\.type)
|
||||||
|
|
||||||
for catalogType in CatalogType.allCases where !catalogTypes.contains(catalogType) {
|
for catalogType in CatalogType.allCases where !catalogTypes.contains(catalogType) {
|
||||||
let catalog: Catalog = .init(type: catalogType, standard: true, customerSeed: false, developerSeed: false, publicSeed: false)
|
let catalog: Catalog = .init(type: catalogType, standard: true, customerSeed: false, developerSeed: false, publicSeed: false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue