simplify and fix issues with RelayStatus

This commit is contained in:
Bryan Montz
2023-06-17 07:19:51 -05:00
committed by William Casarin
parent 2901cc860f
commit 28854fdc93
4 changed files with 34 additions and 50 deletions
+6 -2
View File
@@ -20,8 +20,8 @@ struct RelayView: View {
if showActionButtons {
RemoveButton(privkey: privkey, showText: false)
}
else {
RelayStatus(pool: state.pool, relay: relay)
else if let relay_connection {
RelayStatus(connection: relay_connection)
}
}
@@ -67,6 +67,10 @@ struct RelayView: View {
}
}
private var relay_connection: RelayConnection? {
state.pool.get_relay(relay)?.connection
}
func CopyAction(relay: String) -> some View {
Button {
UIPasteboard.general.setValue(relay, forPasteboardType: "public.plain-text")