From fba798c3ad419befc1a5a41b4da0b76dd3e16d15 Mon Sep 17 00:00:00 2001 From: feruz Date: Wed, 29 Jan 2020 07:06:10 +0200 Subject: [PATCH] remove empty tag before submit --- src/screens/editor/container/editorContainer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index a58c6112e..9c9db7eaf 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -234,7 +234,9 @@ class EditorContainer extends Component { this.setState({ isPostSending: true }); const meta = extractMetadata(fields.body); - const jsonMeta = makeJsonMetadata(meta, fields.tags); + const _tags = fields.tags.filter(tag => tag && tag !== ' '); + + const jsonMeta = makeJsonMetadata(meta, _tags); // TODO: check if permlink is available github: #314 https://github.com/esteemapp/esteem-mobile/pull/314 let permlink = generatePermlink(fields.title); @@ -251,7 +253,7 @@ class EditorContainer extends Component { const author = currentAccount.name; const options = makeOptions(author, permlink); - const parentPermlink = fields.tags[0] || 'hive-125125'; + const parentPermlink = _tags[0] || 'hive-125125'; if (scheduleDate) { await this._setScheduledPost({