Fix missing identity and display error in the browser example

This commit is contained in:
haad 2019-02-21 09:21:12 +02:00
parent f36d86f328
commit 525978e0a9

View File

@ -118,10 +118,8 @@ const main = (IPFS, ORBITDB) => {
await update(db)
} catch (e) {
console.error(e.toString())
if (e.toString() === 'Error: Not allowed to write') {
writerText.innerHTML = '<span style="color: red">' + e.toString() + '</span>'
clearInterval(updateInterval)
}
writerText.innerHTML = '<span style="color: red">' + e.toString() + '</span>'
clearInterval(updateInterval)
}
}, interval)
}
@ -162,7 +160,7 @@ const main = (IPFS, ORBITDB) => {
// If "Public" flag is set, allow anyone to write to the database,
// otherwise only the creator of the database can write
accessController: {
write: publicAccess ? ['*'] : [identity.publicKey],
write: publicAccess ? ['*'] : [orbitdb.identity.publicKey],
}
})