From 2f2974fed7dfa01f9211b7719fc36fa101b7d702 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 May 2019 13:25:34 +0200 Subject: [PATCH 1/2] fallback to txt --- src/app/editor/editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index f447b940a75..ba3b6439171 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] From 0a1bf379f7bee27cc3a672892486b2324fb0d390 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 May 2019 13:25:45 +0200 Subject: [PATCH 2/2] show metadatafile in explorer --- src/app/contract/publishOnSwarm.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/contract/publishOnSwarm.js b/src/app/contract/publishOnSwarm.js index cd4bdb3bac6..d072f722881 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,