IDEA-CR-53387 IDEA-223967 what's new notification: expire it on click and project open listeners optimization

GitOrigin-RevId: 096b28a20e82f0decab9f31fbfd42bee6984d831
This commit is contained in:
Dmitry.Krasilschikov
2019-10-12 21:38:24 +00:00
committed by intellij-monorepo-bot
parent 8d0e2c0c7b
commit 8511dede3d
@@ -65,20 +65,14 @@ public final class UpdateCheckerComponent implements Runnable {
snapPackageNotification();
MessageBusConnection connection = app.getMessageBus().connect();
if (!updateFailed) {
connection.subscribe(ProjectManager.TOPIC, new ProjectManagerListener() {
@Override
public void projectOpened(@NotNull Project project) {
StartupManager.getInstance(project).registerPostStartupActivity(() -> { showWhatsNewNotification(project); });
}
});
}
connection.subscribe(ProjectManager.TOPIC, new ProjectManagerListener() {
@Override
public void projectOpened(@NotNull Project project) {
connection.disconnect();
StartupManager.getInstance(project).registerPostStartupActivity(() -> UpdateInstaller.cleanupPatch());
StartupManager.getInstance(project).registerPostStartupActivity(() -> {
if (!updateFailed) showWhatsNewNotification(project);
UpdateInstaller.cleanupPatch();
});
}
});
});
@@ -116,6 +110,7 @@ public final class UpdateCheckerComponent implements Runnable {
file.putUserData(HTMLEditorProvider.Companion.getHTML_CONTENT_TYPE(), true);
FileEditorManager.getInstance(project).openFile(file, true);
IdeUpdateUsageTriggerCollector.trigger("update.whats.new");
notification.expire();
}
});
properties.setValue(UPDATE_WHATS_NEW_MESSAGE, null);