Add swiftlint & Minor fixes

This commit is contained in:
世界
2025-11-27 16:10:55 +08:00
parent 8855e0eef9
commit 0bfb6d2516
29 changed files with 382 additions and 196 deletions
@@ -18,14 +18,16 @@ public struct ProfileActionToolbar: View {
}
public var body: some View {
#if os(iOS) || os(tvOS)
#if os(iOS)
iosBody
#elseif os(tvOS)
tvOSBody
#elseif os(macOS)
macOSBody
#endif
}
#if os(iOS) || os(tvOS)
#if os(iOS)
private var iosBody: some View {
Section("Action") {
if profile.type != .remote {
@@ -65,6 +67,33 @@ public struct ProfileActionToolbar: View {
}
#endif
#if os(tvOS)
private var tvOSBody: some View {
Section("Action") {
if profile.type == .remote {
FormButton {
viewModel.isLoading = true
Task {
await viewModel.updateProfile(profile, environments: environments)
}
} label: {
Label("Update", systemImage: "arrow.clockwise")
}
.foregroundColor(.accentColor)
.disabled(viewModel.isLoading)
}
FormButton(role: .destructive) {
Task {
await viewModel.deleteProfile(profile, environments: environments, dismiss: dismiss)
}
} label: {
Label("Delete", systemImage: "trash.fill")
}
.foregroundColor(.red)
}
}
#endif
#if os(macOS)
private var macOSBody: some View {
VStack(spacing: 0) {