You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2021/02/23 09:54:10 UTC

[echarts-bot] branch master updated: fix: fix issue translate bug.

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new 532d7cd  fix: fix issue translate bug.
532d7cd is described below

commit 532d7cd31f2cfc89a8eb1571986a4f03d5ce5d0b
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Tue Feb 23 17:51:46 2021 +0800

    fix: fix issue translate bug.
---
 index.js     | 12 +++++++++---
 src/issue.js |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/index.js b/index.js
index fb01555..c58474d 100644
--- a/index.js
+++ b/index.js
@@ -15,6 +15,8 @@ module.exports = (app) => {
             ? Promise.resolve()
             : commentIssue(context, issue.response);
 
+        await comment;
+
         const addLabels = issue.addLabels.length
             ? context.octokit.issues.addLabels(
                 context.issue({
@@ -27,11 +29,15 @@ module.exports = (app) => {
             ? getRemoveLabel(issue.removeLabel)
             : Promise.resolve();
 
+        // then add and remove label
+        await Promise.all([addLabels, removeLabel]);
+
+        // translate finally
         const translate = issue.response === text.ISSUE_CREATED
-            ? Promise.resolve()
-            : translateIssue(context, issue);
+            ? translateIssue(context, issue)
+            : Promise.resolve();
 
-        return Promise.all([comment, addLabels, removeLabel, translate]);
+        return translate;
     });
 
     app.on('issues.labeled', async context => {
diff --git a/src/issue.js b/src/issue.js
index c359ae2..7d900a4 100644
--- a/src/issue.js
+++ b/src/issue.js
@@ -40,7 +40,7 @@ class Issue {
             this.issueType && this.addLabels.push(this.issueType);
 
             // translate issue
-            await this._translate();
+            isCore || await this._translate();
 
             // const isInEnglish = this._contain('This issue is in English');
             const isInEnglish = (!this.translatedTitle && !this.translatedBody)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org