修复自动开启web服务失效

This commit is contained in:
aoi
2026-06-13 20:07:35 +08:00
parent 318bef3649
commit 1bf94b0ed0
2 changed files with 3 additions and 2 deletions
@@ -85,7 +85,7 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
ReadConfig.optimizeRender = value
}
val recordLog get() = OtherConfig.recordLog
var webServiceAutoStart = appCtx.getPrefBoolean(PreferKey.webServiceAutoStart, false)
var webServiceAutoStart = OtherConfig.webServiceAutoStart
// -- lyc 版本特性 --
val adaptSpecialStyle get() = ReadConfig.adaptSpecialStyle
@@ -16,6 +16,7 @@ import io.legado.app.constant.IntentAction
import io.legado.app.constant.NotificationId
import io.legado.app.constant.PreferKey
import io.legado.app.receiver.NetworkChangedListener
import io.legado.app.ui.config.otherConfig.OtherConfig
import io.legado.app.utils.NetworkUtils
import io.legado.app.utils.eventBus.FlowEventBus
import io.legado.app.utils.getPrefBoolean
@@ -118,7 +119,7 @@ class WebService : BaseService() {
when (intent?.action) {
IntentAction.stop -> {
// ——————【修改开始】通知栏点击停止时,也记录关闭状态——————
appCtx.putPrefBoolean("web_service_auto", false)
OtherConfig.webServiceAutoStart = false
stopSelf()
// ——————【修改结束】——————
}