[platform] no bumping for "last checked at" on displaying Snap update notifications

GitOrigin-RevId: 0d61ba58e20d992da6a7946b388a15fd1ce88b83
This commit is contained in:
Roman Shevchenko
2020-10-21 22:07:07 +00:00
committed by intellij-monorepo-bot
parent 985cfa6e1b
commit 32fdc0eaf5
2 changed files with 10 additions and 4 deletions
@@ -200,7 +200,7 @@ final class UpdateCheckerComponent {
BuildNumber lastBuildChecked = BuildNumber.fromString(settings.getLastBuildChecked());
if (lastBuildChecked == null) {
// first IDE start, just save info about build
UpdateSettings.getInstance().saveLastCheckedInfo();
UpdateSettings.getInstance().saveLastCheckedInfo(true);
return;
}
@@ -239,7 +239,7 @@ final class UpdateCheckerComponent {
UpdateChecker.getNotificationGroup().createNotification(
title, message, NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER, "ide.updated.by.snap").notify(null);
UpdateSettings.getInstance().saveLastCheckedInfo();
UpdateSettings.getInstance().saveLastCheckedInfo(true);
}
private static void showUpdatedPluginsNotification(@NotNull Project project) {
@@ -137,8 +137,14 @@ public class UpdateSettings implements PersistentStateComponent<UpdateOptions> {
}
public void saveLastCheckedInfo() {
myState.setLastTimeChecked(System.currentTimeMillis());
saveLastCheckedInfo(false);
}
public void saveLastCheckedInfo(boolean onlyBuild) {
myState.setLastBuildChecked(ApplicationInfo.getInstance().getBuild().asString());
if (!onlyBuild) {
myState.setLastTimeChecked(System.currentTimeMillis());
}
}
public boolean isThirdPartyPluginsAllowed() {
@@ -148,4 +154,4 @@ public class UpdateSettings implements PersistentStateComponent<UpdateOptions> {
public void setThirdPartyPluginsAllowed(boolean value) {
myState.setThirdPartyPluginsAllowed(value);
}
}
}