Fix import remote profile

This commit is contained in:
世界
2023-09-02 20:34:44 +08:00
parent 174d05c8c5
commit 4e5b251d6f
3 changed files with 28 additions and 27 deletions
@@ -1,15 +1,11 @@
import SwiftUI
func NavigationDestinationCompat(isPresented: Binding<Bool>, @ViewBuilder destination: () -> some View) -> some View {
if #unavailable(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0) {
return NavigationLink(
destination: destination(),
isActive: isPresented,
label: {
EmptyView()
}
)
} else {
return EmptyView().navigationDestination(isPresented: isPresented, destination: destination)
}
NavigationLink(
destination: destination(),
isActive: isPresented,
label: {
EmptyView()
}
)
}
@@ -70,6 +70,11 @@ public struct EditProfileView: View {
Text("Share")
}
#endif
ShareButtonCompat($alert) {
Text("Share URL")
} itemURL: {
profile.shareLink
}
Button("Update") {
isLoading = true
Task.detached {
@@ -77,10 +82,10 @@ public struct EditProfileView: View {
}
}
.disabled(isLoading)
Button("Delete", role: .destructive) {
Task.detached {
await deleteProfile()
}
}
Button("Delete", role: .destructive) {
Task.detached {
await deleteProfile()
}
}
}