mirror of
https://github.com/iv-org/invidious.git
synced 2026-03-31 15:18:30 -05:00
fix(preferences): unchecked pages_enabled checkboxes now persist correctly
HTML checkboxes send no value when unchecked, so the fallback "|| \"on\"" always re-enabled popular/trending/search on save. Changed default to "off" to match the pattern used by captcha_enabled, login_enabled, and other checkbox toggles in the same handler.
This commit is contained in:
parent
bd6dd9cb55
commit
ea36b2ba4b
@ -202,9 +202,9 @@ module Invidious::Routes::PreferencesRoute
|
|||||||
CONFIG.default_user_preferences.feed_menu = admin_feed_menu
|
CONFIG.default_user_preferences.feed_menu = admin_feed_menu
|
||||||
|
|
||||||
CONFIG.pages_enabled = PagesEnabled.new(
|
CONFIG.pages_enabled = PagesEnabled.new(
|
||||||
popular: (env.params.body["popular_enabled"]?.try &.as(String) || "on") == "on",
|
popular: (env.params.body["popular_enabled"]?.try &.as(String) || "off") == "on",
|
||||||
trending: (env.params.body["trending_enabled"]?.try &.as(String) || "on") == "on",
|
trending: (env.params.body["trending_enabled"]?.try &.as(String) || "off") == "on",
|
||||||
search: (env.params.body["search_enabled"]?.try &.as(String) || "on") == "on",
|
search: (env.params.body["search_enabled"]?.try &.as(String) || "off") == "on",
|
||||||
)
|
)
|
||||||
|
|
||||||
captcha_enabled = env.params.body["captcha_enabled"]?.try &.as(String)
|
captcha_enabled = env.params.body["captcha_enabled"]?.try &.as(String)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user