diff --git a/src/app/contract/publishOnSwarm.js b/src/app/contract/publishOnSwarm.js index cd4bdb3bac..d072f72288 100644 --- a/src/app/contract/publishOnSwarm.js +++ b/src/app/contract/publishOnSwarm.js @@ -56,6 +56,12 @@ module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => { }) }, () => { swarmVerifiedPublish(JSON.stringify(metadata), '', (error, result) => { + if (!error && swarmVerifiedPublishCallBack) { + swarmVerifiedPublishCallBack({ + content: contract.metadata, + hash: contract.metadataHash + }) + } uploaded.push({ content: contract.metadata, hash: contract.metadataHash, diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index f447b940a7..ba3b643917 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -219,7 +219,9 @@ class Editor { */ _getMode (path) { let ext = path.indexOf('.') !== -1 ? /[^.]+/.exec(path) : null - if (ext) ext = path.replace(ext[0] + '.', '') // we get + if (ext) { + ext = path.replace(ext[0] + '.', '') // we get + } else ext = 'txt' ext = ext.split('#') if (!ext.length) return this.modes['txt'] ext = ext[0]