Skip to content

Commit

Permalink
docs: update name-api example (ipfs#944)
Browse files Browse the repository at this point in the history
Updates deps and fixes example code!

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
  • Loading branch information
Alan Shaw authored Feb 12, 2019
1 parent 2c90620 commit e69aca1
Show file tree
Hide file tree
Showing 3 changed files with 812 additions and 1,331 deletions.
8 changes: 3 additions & 5 deletions examples/name-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const enableForms = () => {
const init = () => {
ipfs.id()
.then(res => {
showStatus(`daemon active\nid: ${res.ID}`, COLORS.success)
showStatus(`daemon active\nid: ${res.id}`, COLORS.success)
enableForms()
})
.catch(err => {
Expand Down Expand Up @@ -77,7 +77,7 @@ const publish = (path) => {

ipfs.name.publish(path)
.then(res => {
const name = res.Name
const name = res.name
showStatus('success!', COLORS.success)
DOM.publishResultsDiv.classList.remove('hidden')
DOM.publishResult.innerText = `/ipns/${name}`
Expand All @@ -95,9 +95,7 @@ const resolve = (name) => {
DOM.resolveResultsDiv.classList.add('hidden')

ipfs.name.resolve(name)
.then(res => {
const path = res.Path

.then(path => {
showStatus('success!', COLORS.success)
DOM.resolveResultsDiv.classList.remove('hidden')
DOM.resolveResult.innerText = path
Expand Down
Loading

0 comments on commit e69aca1

Please sign in to comment.