mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-01-26 15:04:19 +01:00
fix restore from MFS
This commit is contained in:
parent
ce1700c36c
commit
bd4c244110
@ -86,13 +86,17 @@ function BoardsAPI (ipfs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BoardsAPI.prototype.restoreProfileFromMFS = function (done) {
|
BoardsAPI.prototype.restoreProfileFromMFS = function (done) {
|
||||||
this.ipfs.files.stat('/ipfs-boards-profile', (err, res) => {
|
this.ipfs.files.stat('/ipfs-boards-profile', (err, r) => {
|
||||||
if (err) return done(err)
|
if (err) return done(err)
|
||||||
this.ipfs.name.publish(res.Hash, done)
|
this.ipfs.files.stat('/', (err, res) => {
|
||||||
|
if (err) return done(err)
|
||||||
|
this.ipfs.name.publish(res.Hash, done)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardsAPI.prototype.restoreProfileFromIPFS = function (hash, done) {
|
BoardsAPI.prototype.restoreProfileFromIPFS = function (hash, done) {
|
||||||
|
// TODO: cp it into mfs or this won't work
|
||||||
this.ipfs.name.publish(hash, done)
|
this.ipfs.name.publish(hash, done)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user