Merge pull request #2007 from ethereum/fixToaster

Various fixes
pull/3094/head
yann300 6 years ago committed by GitHub
commit 23feea1fd8
  1. 6
      src/app/contract/publishOnSwarm.js
  2. 4
      src/app/editor/editor.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,

@ -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 <ext>
if (ext) {
ext = path.replace(ext[0] + '.', '') // we get <ext>
} else ext = 'txt'
ext = ext.split('#')
if (!ext.length) return this.modes['txt']
ext = ext[0]

Loading…
Cancel
Save