Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use instance of service on-demand instead #90

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ object IntellijNotificationService : NotificationsService {
private val LOGGER = PluginLogger<IntellijNotificationService>()
private val ICON = IconLoader.getIcon("/META-INF/pluginIcon.svg", AutoDarkMode::class.java)

private val NOTIFICATION_GROUP = NotificationGroupManager.getInstance()
.getNotificationGroup("com.github.weisj.darkmode")

/*
* Notifications may not be displayed of they are dispatched before the application frame has been
* fully created. We queue any incoming messages and dispatch them as soon as the application is ready.
Expand All @@ -75,7 +72,8 @@ object IntellijNotificationService : NotificationsService {
}

override fun dispatchNotification(message: String, type: NotificationType, showSettingsLink: Boolean) {
val notification = NOTIFICATION_GROUP.createNotification(
val notificationGroup = NotificationGroupManager.getInstance().getNotificationGroup("com.github.weisj.darkmode")
val notification = notificationGroup.createNotification(
title = "Auto Dark Mode",
content = message,
type = type.toIntelliJType()
Expand Down
Loading