Skip to content

Commit

Permalink
Fixed bug with primaryKey formatting (#1)
Browse files Browse the repository at this point in the history
* Added descriptive variables to dht.mjs

* removed unnecessary specifications

* Added descriptive variable and comment to key.msj

* Update dht.mjs

* added correct formatting method to key.mjs

* Update dht.mjs

* Update dht.mjs & key.mjs
  • Loading branch information
Manolais authored Mar 13, 2023
1 parent 2037d64 commit 21c6f00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dht.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default function useDHT () {
useEffect(() => {
if (primaryKey === null) return

const keyPair = DHT.keyPair(primaryKey)

const ws = new window.WebSocket('wss://dht1-relay.leet.ar:49443') // + add more relays
const dht = new DHT(new Stream(true, ws), {
keyPair: DHT.keyPair(b4a.from(primaryKey, 'hex'))
})
const dht = new DHT(new Stream(true, ws), { keyPair })

setDHT(dht)

Expand Down
2 changes: 1 addition & 1 deletion key.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function useKey () {
window.localStorage.setItem('primary-key', primaryKey)
}

setKey(b4a.from(primaryKey))
setKey(b4a.from(primaryKey, 'hex'))
}, [])

return [key]
Expand Down

0 comments on commit 21c6f00

Please sign in to comment.