This commit is contained in:
世界
2023-09-24 13:23:39 +08:00
parent 58bc9baa05
commit e65680dd55
4 changed files with 38 additions and 28 deletions
@@ -170,6 +170,7 @@ public struct EditProfileView: View {
do {
try await Task.sleep(nanoseconds: UInt64(100 * Double(NSEC_PER_MSEC)))
try await profile.updateRemoteProfile()
await performCallback()
} catch {
alert = Alert(error)
}
@@ -189,11 +190,11 @@ public struct EditProfileView: View {
private func saveProfile() async {
do {
_ = try await ProfileManager.update(profile)
#if os(iOS) || os(tvOS)
try await UIProfileUpdateTask.configure()
#else
try await ProfileUpdateTask.configure()
#endif
#if os(iOS) || os(tvOS)
try await UIProfileUpdateTask.configure()
#else
try await ProfileUpdateTask.configure()
#endif
} catch {
alert = Alert(error)
return
@@ -248,11 +248,11 @@ public struct NewProfileView: View {
lastUpdated: lastUpdated
))
if profileType == .remote {
#if os(iOS) || os(tvOS)
try await UIProfileUpdateTask.configure()
#else
try await ProfileUpdateTask.configure()
#endif
#if os(iOS) || os(tvOS)
try await UIProfileUpdateTask.configure()
#else
try await ProfileUpdateTask.configure()
#endif
}
}
}
@@ -34,7 +34,7 @@ public struct ProfileView: View {
public init() {}
public var body: some View {
viewBuilder {
VStack {
if isLoading {
ProgressView().onAppear {
Task {
@@ -222,6 +222,9 @@ public struct ProfileView: View {
isLoading = false
}
do {
if !profileList.isEmpty {
profileList.removeAll()
}
profileList = try await ProfileManager.list()
} catch {
alert = Alert(error)