mirror of
https://github.com/yggdrasil-network/yggdrasil-ios.git
synced 2025-04-28 14:15:09 +03:00
Always show peer add button
This commit is contained in:
parent
b0c3d045a3
commit
f0c29a8a3e
1 changed files with 11 additions and 13 deletions
|
@ -98,19 +98,17 @@ struct PeersView: View {
|
||||||
.navigationTitle("Peers")
|
.navigationTitle("Peers")
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
if editMode!.wrappedValue.isEditing {
|
Button("Add", systemImage: "plus") {
|
||||||
Button("Add", systemImage: "plus") {
|
//appDelegate.yggdrasilConfig.peers.append("")
|
||||||
//appDelegate.yggdrasilConfig.peers.append("")
|
addPeerURI = ""
|
||||||
addPeerURI = ""
|
isAddingPeer.toggle()
|
||||||
isAddingPeer.toggle()
|
}.alert("Add new peer", isPresented: $isAddingPeer) {
|
||||||
}.alert("Add new peer", isPresented: $isAddingPeer) {
|
TextField("tls://host:port", text: $addPeerURI)
|
||||||
TextField("tls://host:port", text: $addPeerURI)
|
.textInputAutocapitalization(.never)
|
||||||
.textInputAutocapitalization(.never)
|
Button("Add", action: addPeer)
|
||||||
Button("Add", action: addPeer)
|
Button("Cancel", role: .cancel) { }
|
||||||
Button("Cancel", role: .cancel) { }
|
} message: {
|
||||||
} message: {
|
Text("Specify the peer URI to add.")
|
||||||
Text("Specify the peer URI to add.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
EditButton()
|
EditButton()
|
||||||
.onChange(of: editMode!.wrappedValue) { edit in
|
.onChange(of: editMode!.wrappedValue) { edit in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue