1
0
mirror of https://github.com/fazo96/ipfs-boards synced 2025-01-10 12:24:20 +01:00

fix restore from MFS

This commit is contained in:
Enrico Fasoli 2016-02-05 17:20:05 +01:00
parent ce1700c36c
commit bd4c244110

View File

@ -86,13 +86,17 @@ function BoardsAPI (ipfs) {
}
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)
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) {
// TODO: cp it into mfs or this won't work
this.ipfs.name.publish(hash, done)
}