Fixed adding peer?

master
Keith Irwin 2022-09-13 11:09:09 -06:00
parent c9a645c128
commit 836cdbdaaf
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 2 additions and 4 deletions

View File

@ -8,12 +8,10 @@
<h2>Your peers</h2>
<table>
<thead><tr>
<th>Host</th><th>IPv4</th><th>IPv6</th><th></th>
<th>Host</th><th></th>
</tr></thead>
<tbody data-bind="foreach:peers"><tr>
<td data-bind="text:domain"></td>
<td data-bind="text:ipv4"></td>
<td data-bind="text:ipv6"></td>
<td><button style="float:right" data-bind="click:$parent.delPeer,disable:$data.isDeleting,text:deleteText">Delete</button></td>
</tr></tbody>
</table>

View File

@ -52,7 +52,7 @@ function PeerList() {
} else if (!/^([\-\_a-z0-9]{3,12})$/.test(validName)) {
alert('Name must be 3-12 alphanumeric chars.')
self.isAdding(false)
} else if (self.peers().map((peer)=>peer.name()).includes(validName)) {
} else if (self.peers().map((peer)=>peer.name.split('.')[0]).includes(validName)) {
alert(`You already have a peer named ${validName}!`)
self.isAdding(false)
} else {