Skip to content

Commit 680a9f2

Browse files
committed
refactor: replace EdtScheduledExecutorService with suspending delay
1 parent 4527295 commit 680a9f2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/main/kotlin/com/github/lppedd/cc/whatsnew/WhatsNewStartupActivity.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import com.github.lppedd.cc.service
77
import com.intellij.openapi.project.DumbAware
88
import com.intellij.openapi.project.Project
99
import com.intellij.openapi.startup.ProjectActivity
10-
import com.intellij.util.concurrency.EdtScheduledExecutorService
11-
import java.util.concurrent.TimeUnit
10+
import kotlinx.coroutines.delay
1211

1312
/**
1413
* Verifies the need to display the What's New dialog at startup.
@@ -29,11 +28,11 @@ internal class WhatsNewStartupActivity : ProjectActivity, DumbAware {
2928
.any { it.getPages().isNotEmpty() }
3029

3130
if (shouldDisplay) {
32-
EdtScheduledExecutorService.getInstance().schedule({
33-
if (!project.isDisposed) {
34-
WhatsNewDialog.showForProject(project)
35-
}
36-
}, 1100L, TimeUnit.MILLISECONDS)
31+
delay(1100L)
32+
33+
if (!project.isDisposed) {
34+
WhatsNewDialog.showForProject(project)
35+
}
3736
}
3837
}
3938
}

0 commit comments

Comments
 (0)