IkigaiMangas: Update cached value on preference change (#7089)

update cached value on pref update
This commit is contained in:
bapeey 2025-01-10 18:46:39 -05:00 committed by Draff
parent 8d91fc6551
commit bdadddf27c
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Ikigai Mangas'
extClass = '.IkigaiMangas'
extVersionCode = 21
extVersionCode = 22
isNsfw = true
}

View File

@ -278,6 +278,10 @@ class IkigaiMangas : HttpSource(), ConfigurableSource {
key = SHOW_NSFW_PREF
title = SHOW_NSFW_PREF_TITLE
setDefaultValue(SHOW_NSFW_PREF_DEFAULT)
setOnPreferenceChangeListener { _, newValue ->
_cachedNsfwPref = newValue as Boolean
true
}
}.also { screen.addPreference(it) }
SwitchPreferenceCompat(screen.context).apply {