Skip to content

Commit

Permalink
Listen to server config value changes - Update system tray icon
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda committed Jul 28, 2023
1 parent 7d1e6e2 commit 3435923
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,17 @@ fun applicationSetup() {
LocalSource.register()

// create system tray
if (serverConfig.systemTrayEnabled.value) {
serverConfig.subscribeTo(serverConfig.systemTrayEnabled, { systemTrayEnabled ->
try {
systemTrayInstance
if (systemTrayEnabled) {
systemTrayInstance
} else {
systemTrayInstance?.remove()
}
} catch (e: Throwable) { // cover both java.lang.Exception and java.lang.Error
e.printStackTrace()
}
}
}, ignoreInitialValue = false)

// Disable jetty's logging
System.setProperty("org.eclipse.jetty.util.log.announce", "false")
Expand Down

0 comments on commit 3435923

Please sign in to comment.