a demonstration replicated social networking web app built with anproto wiredove.net/
social ed25519 protocols

just save key and reload if name is too short

+16 -11
+16 -11
identify.js
··· 41 41 const pubkey = h('span', {classList: 'pubkey'}) 42 42 const button = h('button', { 43 43 onclick: async () => { 44 - const alreadyButton = document.getElementById('saveButton') 45 - if (alreadyButton) { alreadyButton.remove() } 46 - let done = true 47 - const genInterval = setInterval(async _ => { 48 - const keypair = await bogbot.generate() 49 - pubkey.textContent = keypair.substring(0, 10) 50 - if (keypair.substring(0, 2).toUpperCase() === name.substring(0, 2).toUpperCase()) { 51 - clearInterval(genInterval) 52 - pubkey.after(await saveButton(keypair)) 53 - } 54 - }, .000001) 44 + if (name.length > 1) { 45 + const alreadyButton = document.getElementById('saveButton') 46 + if (alreadyButton) { alreadyButton.remove() } 47 + let done = true 48 + const genInterval = setInterval(async _ => { 49 + const keypair = await bogbot.generate() 50 + pubkey.textContent = keypair.substring(0, 10) 51 + if (keypair.substring(0, 2).toUpperCase() === name.substring(0, 2).toUpperCase()) { 52 + clearInterval(genInterval) 53 + pubkey.after(await saveButton(keypair)) 54 + } 55 + }, .000001) 56 + } else { 57 + await bogbot.put('keypair', initial) 58 + document.location.reload() 59 + } 55 60 } 56 61 }, ['Generate']) 57 62 button.click()