From a54b6ce6ef452d46ddca61be503c76bd6b62682e Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 26 Apr 2019 12:27:15 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-16461=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E5=85=B3=E9=97=AD=E8=87=AA=E5=8A=A8=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../push/DesignerPushUpdateManager.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java index 7ac254c93..f867d6cfd 100644 --- a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java +++ b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java @@ -13,28 +13,29 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; -import java.io.IOException; - /** * Created by plough on 2019/4/8. */ public class DesignerPushUpdateManager { private static final String SPLIT_CHAR = "-"; private static DesignerPushUpdateManager singleton; + private static DesignerPushUpdateConfigManager config; + private DesignerUpdateInfo updateInfo; - private DesignerPushUpdateConfigManager config; static { - DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { - @Override - public void designerOpened() { - getInstance().checkAndPop(); - } - }); + config = DesignerPushUpdateConfigManager.getInstance(); + if (config.isAutoPushUpdateEnabled()) { + DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { + @Override + public void designerOpened() { + getInstance().checkAndPop(); + } + }); + } } private DesignerPushUpdateManager() { - config = DesignerPushUpdateConfigManager.getInstance(); } public static DesignerPushUpdateManager getInstance() { @@ -56,7 +57,7 @@ public class DesignerPushUpdateManager { try { String res = HttpToolbox.get(CloudCenter.getInstance().acquireUrlByKind("jar10.update")); return new JSONObject(res).optString("buildNO"); - } catch (IOException e) { + } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } return StringUtils.EMPTY;