Created
August 11, 2019 03:23
-
-
Save bitnom/bffb8c1b5df6d8aca99701c5d78814fc to your computer and use it in GitHub Desktop.
Gun creates multiple public keys per-user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gun.on('auth', function(){ | |
$('.loggedOut').hide(); | |
$('.loggedIn').show(); | |
user.get('said').map().once(UI); | |
user.get('alias').val(function(name){ | |
//console.log(name) | |
if(upPub !== null){ | |
let peers = gun.get('peers') | |
peers.once(function(data){ | |
let uSet = {name: name, pub: upPub} | |
//console.log("calling setu with ", uSet) | |
if(data){ | |
//console.log("calling setu with ", uSet) | |
setu(peers, uSet) | |
}else{ | |
peers.set(uSet) | |
} | |
}) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment