mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
ShowK2SurveyNotificationAfterRestartPostStartupActivity - use serviceAsync
GitOrigin-RevId: f108a1f79a2fadc3c4a9eaeac37cfdfc8f40bfd0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7dc463edba
commit
bfba16dff8
@@ -3,23 +3,21 @@ package org.jetbrains.kotlin.onboarding.k2.satisfaction.survey
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.openapi.components.serviceAsync
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.diagnostic.debug
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.startup.ProjectActivity
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.platform.feedback.impl.OnDemandFeedbackResolver
|
||||
|
||||
internal class ShowK2SurveyNotificationAfterRestartPostStartupActivity : ProjectActivity {
|
||||
|
||||
companion object {
|
||||
private val LOG = Logger.getInstance(ShowK2SurveyNotificationAfterRestartPostStartupActivity::class.java)
|
||||
}
|
||||
|
||||
private class ShowK2SurveyNotificationAfterRestartPostStartupActivity : ProjectActivity {
|
||||
override suspend fun execute(project: Project) {
|
||||
K2UserTracker.getInstance().checkIfKotlinPluginModeWasSwitchedOnRestart()
|
||||
serviceAsync<K2UserTracker>().checkIfKotlinPluginModeWasSwitchedOnRestart()
|
||||
val propertiesComponent = serviceAsync<PropertiesComponent>()
|
||||
val propertiesComponentKey = "K2KotlinSurveyWasProposedOnAppRestart"
|
||||
LOG.debug("propertiesComponent.getBoolean($propertiesComponentKey) " + propertiesComponent.getBoolean(propertiesComponentKey))
|
||||
logger<ShowK2SurveyNotificationAfterRestartPostStartupActivity>().debug {
|
||||
"propertiesComponent.getBoolean($propertiesComponentKey) " + propertiesComponent.getBoolean(propertiesComponentKey)
|
||||
}
|
||||
if (Registry.`is`("test.k2.feedback.survey", false) || !propertiesComponent.getBoolean(propertiesComponentKey)) {
|
||||
if (OnDemandFeedbackResolver.getInstance().showFeedbackNotification(K2FeedbackSurvey::class, project)) {
|
||||
propertiesComponent.updateValue(propertiesComponentKey, /* newValue = */ true)
|
||||
|
||||
Reference in New Issue
Block a user