mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-08 22:12:23 +00:00
Swiftformat
This commit is contained in:
parent
06629cc397
commit
83e4e74329
22 changed files with 171 additions and 169 deletions
|
@ -5,9 +5,9 @@ import Env
|
||||||
import Foundation
|
import Foundation
|
||||||
import Models
|
import Models
|
||||||
import Network
|
import Network
|
||||||
|
import Nuke
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Timeline
|
import Timeline
|
||||||
import Nuke
|
|
||||||
|
|
||||||
struct SettingsTabs: View {
|
struct SettingsTabs: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
|
@ -4,7 +4,6 @@ import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
class EditAccountViewModel: ObservableObject {
|
class EditAccountViewModel: ObservableObject {
|
||||||
|
|
||||||
class FieldEditViewModel: ObservableObject, Identifiable {
|
class FieldEditViewModel: ObservableObject, Identifiable {
|
||||||
let id = UUID().uuidString
|
let id = UUID().uuidString
|
||||||
@Published var name: String = ""
|
@Published var name: String = ""
|
||||||
|
|
|
@ -10,6 +10,7 @@ public class QuickLook: ObservableObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Published public private(set) var urls: [URL] = []
|
@Published public private(set) var urls: [URL] = []
|
||||||
@Published public private(set) var isPreparing: Bool = false
|
@Published public private(set) var isPreparing: Bool = false
|
||||||
@Published public private(set) var latestError: Error?
|
@Published public private(set) var latestError: Error?
|
||||||
|
@ -73,7 +74,7 @@ public class QuickLook: ObservableObject {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
private func cleanup(urls: [URL]) {
|
private func cleanup(urls _: [URL]) {
|
||||||
try? FileManager.default.removeItem(at: quickLookDir)
|
try? FileManager.default.removeItem(at: quickLookDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,8 @@ public struct UpdateCredentialsData: Encodable, Sendable {
|
||||||
bot: Bool,
|
bot: Bool,
|
||||||
locked: Bool,
|
locked: Bool,
|
||||||
discoverable: Bool,
|
discoverable: Bool,
|
||||||
fieldsAttributes: [FieldData]) {
|
fieldsAttributes: [FieldData])
|
||||||
|
{
|
||||||
self.displayName = displayName
|
self.displayName = displayName
|
||||||
self.note = note
|
self.note = note
|
||||||
self.source = source
|
self.source = source
|
||||||
|
@ -204,5 +205,4 @@ public struct UpdateCredentialsData: Encodable, Sendable {
|
||||||
}
|
}
|
||||||
self.fieldsAttributes = fieldAttributes
|
self.fieldsAttributes = fieldAttributes
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,6 @@ public extension URL {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extension UIImage {
|
extension UIImage {
|
||||||
func resized(to size: CGSize) -> UIImage {
|
func resized(to size: CGSize) -> UIImage {
|
||||||
UIGraphicsImageRenderer(size: size).image { _ in
|
UIGraphicsImageRenderer(size: size).image { _ in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUI
|
|
||||||
import Models
|
import Models
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
class StatusEmbedCache {
|
class StatusEmbedCache {
|
||||||
|
|
|
@ -99,7 +99,8 @@ public class StatusRowViewModel: ObservableObject {
|
||||||
isFiltered = filter != nil
|
isFiltered = filter != nil
|
||||||
|
|
||||||
if let url = embededStatusURL(),
|
if let url = embededStatusURL(),
|
||||||
let embed = StatusEmbedCache.shared.get(url: url) {
|
let embed = StatusEmbedCache.shared.get(url: url)
|
||||||
|
{
|
||||||
isEmbedLoading = false
|
isEmbedLoading = false
|
||||||
embeddedStatus = embed
|
embeddedStatus = embed
|
||||||
}
|
}
|
||||||
|
@ -159,7 +160,8 @@ public class StatusRowViewModel: ObservableObject {
|
||||||
let content = status.reblog?.content ?? status.content
|
let content = status.reblog?.content ?? status.content
|
||||||
if !content.statusesURLs.isEmpty,
|
if !content.statusesURLs.isEmpty,
|
||||||
let url = content.statusesURLs.first,
|
let url = content.statusesURLs.first,
|
||||||
client.hasConnection(with: url) {
|
client.hasConnection(with: url)
|
||||||
|
{
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -167,7 +169,8 @@ public class StatusRowViewModel: ObservableObject {
|
||||||
|
|
||||||
func loadEmbeddedStatus() async {
|
func loadEmbeddedStatus() async {
|
||||||
guard embeddedStatus == nil,
|
guard embeddedStatus == nil,
|
||||||
let url = embededStatusURL() else {
|
let url = embededStatusURL()
|
||||||
|
else {
|
||||||
if isEmbedLoading {
|
if isEmbedLoading {
|
||||||
isEmbedLoading = false
|
isEmbedLoading = false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue