mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
only open browser when appropriate
This commit is contained in:
@@ -22,7 +22,6 @@ class SystemPropertyOverrideDelegate(val config: Config, val moduleName: String)
|
|||||||
inline operator fun <R, reified T> getValue(thisRef: R, property: KProperty<*>): T {
|
inline operator fun <R, reified T> getValue(thisRef: R, property: KProperty<*>): T {
|
||||||
val configValue: T = config.getValue(thisRef, property)
|
val configValue: T = config.getValue(thisRef, property)
|
||||||
|
|
||||||
println("getting " + "suwayomi.tachidesk.config.$moduleName.${property.name}")
|
|
||||||
val combined = System.getProperty(
|
val combined = System.getProperty(
|
||||||
"suwayomi.tachidesk.config.$moduleName.${property.name}",
|
"suwayomi.tachidesk.config.$moduleName.${property.name}",
|
||||||
configValue.toString()
|
configValue.toString()
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ object JavalinSetup {
|
|||||||
config.enableCorsForAllOrigins()
|
config.enableCorsForAllOrigins()
|
||||||
}.events { event ->
|
}.events { event ->
|
||||||
event.serverStarted {
|
event.serverStarted {
|
||||||
if (serverConfig.webUIEnabled && serverConfig.initialOpenInBrowserEnabled) {
|
if (serverConfig.initialOpenInBrowserEnabled) {
|
||||||
Browser.openInBrowser()
|
Browser.openInBrowser()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ object Browser {
|
|||||||
private val electronInstances = mutableListOf<Any>()
|
private val electronInstances = mutableListOf<Any>()
|
||||||
|
|
||||||
fun openInBrowser() {
|
fun openInBrowser() {
|
||||||
|
if (serverConfig.webUIEnabled) {
|
||||||
if (serverConfig.webUIBrowser == ("electron")) {
|
if (serverConfig.webUIBrowser == ("electron")) {
|
||||||
try {
|
try {
|
||||||
val electronPath = serverConfig.electronPath
|
val electronPath = serverConfig.electronPath
|
||||||
@@ -33,3 +34,4 @@ object Browser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user