Remove redundant local_user.auto_expand setting. (#5041)
- Fixes #4643 Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
This commit is contained in:
parent
9eee61dd06
commit
a65be776e3
8 changed files with 7 additions and 9 deletions
|
@ -130,7 +130,6 @@ pub async fn save_user_settings(
|
||||||
send_notifications_to_email: data.send_notifications_to_email,
|
send_notifications_to_email: data.send_notifications_to_email,
|
||||||
show_nsfw: data.show_nsfw,
|
show_nsfw: data.show_nsfw,
|
||||||
blur_nsfw: data.blur_nsfw,
|
blur_nsfw: data.blur_nsfw,
|
||||||
auto_expand: data.auto_expand,
|
|
||||||
show_bot_accounts: data.show_bot_accounts,
|
show_bot_accounts: data.show_bot_accounts,
|
||||||
default_post_sort_type,
|
default_post_sort_type,
|
||||||
default_comment_sort_type,
|
default_comment_sort_type,
|
||||||
|
|
|
@ -84,8 +84,8 @@ pub struct CaptchaResponse {
|
||||||
pub struct SaveUserSettings {
|
pub struct SaveUserSettings {
|
||||||
/// Show nsfw posts.
|
/// Show nsfw posts.
|
||||||
pub show_nsfw: Option<bool>,
|
pub show_nsfw: Option<bool>,
|
||||||
|
/// Blur nsfw posts.
|
||||||
pub blur_nsfw: Option<bool>,
|
pub blur_nsfw: Option<bool>,
|
||||||
pub auto_expand: Option<bool>,
|
|
||||||
/// Your user's theme.
|
/// Your user's theme.
|
||||||
pub theme: Option<String>,
|
pub theme: Option<String>,
|
||||||
/// The default post listing type, usually "local"
|
/// The default post listing type, usually "local"
|
||||||
|
|
|
@ -127,7 +127,6 @@ pub async fn import_settings(
|
||||||
show_read_posts: data.settings.as_ref().map(|s| s.show_read_posts),
|
show_read_posts: data.settings.as_ref().map(|s| s.show_read_posts),
|
||||||
open_links_in_new_tab: data.settings.as_ref().map(|s| s.open_links_in_new_tab),
|
open_links_in_new_tab: data.settings.as_ref().map(|s| s.open_links_in_new_tab),
|
||||||
blur_nsfw: data.settings.as_ref().map(|s| s.blur_nsfw),
|
blur_nsfw: data.settings.as_ref().map(|s| s.blur_nsfw),
|
||||||
auto_expand: data.settings.as_ref().map(|s| s.auto_expand),
|
|
||||||
infinite_scroll_enabled: data.settings.as_ref().map(|s| s.infinite_scroll_enabled),
|
infinite_scroll_enabled: data.settings.as_ref().map(|s| s.infinite_scroll_enabled),
|
||||||
post_listing_mode: data.settings.as_ref().map(|s| s.post_listing_mode),
|
post_listing_mode: data.settings.as_ref().map(|s| s.post_listing_mode),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
|
@ -459,7 +459,6 @@ diesel::table! {
|
||||||
totp_2fa_secret -> Nullable<Text>,
|
totp_2fa_secret -> Nullable<Text>,
|
||||||
open_links_in_new_tab -> Bool,
|
open_links_in_new_tab -> Bool,
|
||||||
blur_nsfw -> Bool,
|
blur_nsfw -> Bool,
|
||||||
auto_expand -> Bool,
|
|
||||||
infinite_scroll_enabled -> Bool,
|
infinite_scroll_enabled -> Bool,
|
||||||
admin -> Bool,
|
admin -> Bool,
|
||||||
post_listing_mode -> PostListingModeEnum,
|
post_listing_mode -> PostListingModeEnum,
|
||||||
|
|
|
@ -49,7 +49,6 @@ pub struct LocalUser {
|
||||||
/// Open links in a new tab.
|
/// Open links in a new tab.
|
||||||
pub open_links_in_new_tab: bool,
|
pub open_links_in_new_tab: bool,
|
||||||
pub blur_nsfw: bool,
|
pub blur_nsfw: bool,
|
||||||
pub auto_expand: bool,
|
|
||||||
/// Whether infinite scroll is enabled.
|
/// Whether infinite scroll is enabled.
|
||||||
pub infinite_scroll_enabled: bool,
|
pub infinite_scroll_enabled: bool,
|
||||||
/// Whether the person is an admin.
|
/// Whether the person is an admin.
|
||||||
|
@ -104,8 +103,6 @@ pub struct LocalUserInsertForm {
|
||||||
#[new(default)]
|
#[new(default)]
|
||||||
pub blur_nsfw: Option<bool>,
|
pub blur_nsfw: Option<bool>,
|
||||||
#[new(default)]
|
#[new(default)]
|
||||||
pub auto_expand: Option<bool>,
|
|
||||||
#[new(default)]
|
|
||||||
pub infinite_scroll_enabled: Option<bool>,
|
pub infinite_scroll_enabled: Option<bool>,
|
||||||
#[new(default)]
|
#[new(default)]
|
||||||
pub admin: Option<bool>,
|
pub admin: Option<bool>,
|
||||||
|
@ -143,7 +140,6 @@ pub struct LocalUserUpdateForm {
|
||||||
pub totp_2fa_secret: Option<Option<String>>,
|
pub totp_2fa_secret: Option<Option<String>>,
|
||||||
pub open_links_in_new_tab: Option<bool>,
|
pub open_links_in_new_tab: Option<bool>,
|
||||||
pub blur_nsfw: Option<bool>,
|
pub blur_nsfw: Option<bool>,
|
||||||
pub auto_expand: Option<bool>,
|
|
||||||
pub infinite_scroll_enabled: Option<bool>,
|
pub infinite_scroll_enabled: Option<bool>,
|
||||||
pub admin: Option<bool>,
|
pub admin: Option<bool>,
|
||||||
pub post_listing_mode: Option<PostListingMode>,
|
pub post_listing_mode: Option<PostListingMode>,
|
||||||
|
|
|
@ -235,7 +235,6 @@ mod tests {
|
||||||
person_id: inserted_sara_local_user.person_id,
|
person_id: inserted_sara_local_user.person_id,
|
||||||
email: inserted_sara_local_user.email,
|
email: inserted_sara_local_user.email,
|
||||||
show_nsfw: inserted_sara_local_user.show_nsfw,
|
show_nsfw: inserted_sara_local_user.show_nsfw,
|
||||||
auto_expand: inserted_sara_local_user.auto_expand,
|
|
||||||
blur_nsfw: inserted_sara_local_user.blur_nsfw,
|
blur_nsfw: inserted_sara_local_user.blur_nsfw,
|
||||||
theme: inserted_sara_local_user.theme,
|
theme: inserted_sara_local_user.theme,
|
||||||
default_post_sort_type: inserted_sara_local_user.default_post_sort_type,
|
default_post_sort_type: inserted_sara_local_user.default_post_sort_type,
|
||||||
|
|
3
migrations/2024-09-23-133038_remove_auto_expand/down.sql
Normal file
3
migrations/2024-09-23-133038_remove_auto_expand/down.sql
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE local_user
|
||||||
|
ADD COLUMN auto_expand boolean NOT NULL DEFAULT FALSE;
|
||||||
|
|
3
migrations/2024-09-23-133038_remove_auto_expand/up.sql
Normal file
3
migrations/2024-09-23-133038_remove_auto_expand/up.sql
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE local_user
|
||||||
|
DROP COLUMN auto_expand;
|
||||||
|
|
Loading…
Reference in a new issue