refactor: improve alert error context and copy action

This commit is contained in:
世界
2026-02-08 18:25:55 +08:00
parent a86dfc26d1
commit 8897e6deeb
32 changed files with 125 additions and 82 deletions
@@ -223,14 +223,14 @@ public struct NewProfileMenuView: View {
environments.profileUpdate.send()
dismiss()
} catch {
alert = AlertState(error: error)
alert = AlertState(action: "import profile", error: error)
}
}
},
secondaryButton: .cancel()
)
} catch {
alert = AlertState(error: error)
alert = AlertState(action: "read imported profile file", error: error)
}
}
}
@@ -250,7 +250,7 @@ public struct NewProfileMenuView: View {
var error: NSError?
let remoteProfile = LibboxParseRemoteProfileImportLink(string, &error)
if let error {
alert = AlertState(error: error)
alert = AlertState(action: "parse QR code profile link", error: error)
return
}
guard let remoteProfile else {
@@ -274,14 +274,14 @@ public struct NewProfileMenuView: View {
environments.profileUpdate.send()
dismiss()
} catch {
alert = AlertState(error: error)
alert = AlertState(action: "import profile", error: error)
}
}
},
secondaryButton: .cancel()
)
} catch {
alert = AlertState(error: error)
alert = AlertState(action: "decode QRS profile data", error: error)
}
}
#endif