Browse Source

REPORT-16461 设计器中关闭自动推送更新无效=>调整代码

research/10.0
plough 6 years ago
parent
commit
71025a0b74
  1. 8
      designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java

8
designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java

@ -19,13 +19,11 @@ import com.fr.workspace.WorkContext;
public class DesignerPushUpdateManager { public class DesignerPushUpdateManager {
private static final String SPLIT_CHAR = "-"; private static final String SPLIT_CHAR = "-";
private static DesignerPushUpdateManager singleton; private static DesignerPushUpdateManager singleton;
private static DesignerPushUpdateConfigManager config;
private DesignerUpdateInfo updateInfo; private DesignerUpdateInfo updateInfo;
static { static {
config = DesignerPushUpdateConfigManager.getInstance(); if (DesignerPushUpdateConfigManager.getInstance().isAutoPushUpdateEnabled()) {
if (config.isAutoPushUpdateEnabled()) {
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() {
@Override @Override
public void designerOpened() { public void designerOpened() {
@ -46,7 +44,7 @@ public class DesignerPushUpdateManager {
} }
private void initUpdateInfo(String currentVersion, String latestVersion) { private void initUpdateInfo(String currentVersion, String latestVersion) {
String lastIgnoredVersion = config.getLastIgnoredVersion(); String lastIgnoredVersion = DesignerPushUpdateConfigManager.getInstance().getLastIgnoredVersion();
String updatePushInfo = CloudCenter.getInstance().acquireUrlByKind("update.push"); String updatePushInfo = CloudCenter.getInstance().acquireUrlByKind("update.push");
JSONObject pushData = new JSONObject(updatePushInfo); JSONObject pushData = new JSONObject(updatePushInfo);
@ -165,6 +163,6 @@ public class DesignerPushUpdateManager {
if (updateInfo == null) { if (updateInfo == null) {
return; return;
} }
config.setLastIgnoredVersion(updateInfo.getPushVersion()); DesignerPushUpdateConfigManager.getInstance().setLastIgnoredVersion(updateInfo.getPushVersion());
} }
} }

Loading…
Cancel
Save