Skip to content

Instantly share code, notes, and snippets.

@bitnom
Created August 11, 2019 03:23
Show Gist options
  • Save bitnom/bffb8c1b5df6d8aca99701c5d78814fc to your computer and use it in GitHub Desktop.
Save bitnom/bffb8c1b5df6d8aca99701c5d78814fc to your computer and use it in GitHub Desktop.
Gun creates multiple public keys per-user
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