mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-17 09:25:50 +00:00
Add infinite scroll user option (#3572)
This commit is contained in:
parent
c060546ffa
commit
9b5e765364
@ -133,6 +133,7 @@ impl Perform for SaveUserSettings {
|
||||
.totp_2fa_secret(totp_2fa_secret)
|
||||
.totp_2fa_url(totp_2fa_url)
|
||||
.open_links_in_new_tab(data.open_links_in_new_tab)
|
||||
.infinite_scroll_enabled(data.infinite_scroll_enabled)
|
||||
.build();
|
||||
|
||||
let local_user_res =
|
||||
|
@ -133,6 +133,8 @@ pub struct SaveUserSettings {
|
||||
pub auth: Sensitive<String>,
|
||||
/// Open links in a new tab
|
||||
pub open_links_in_new_tab: Option<bool>,
|
||||
/// Enable infinite scroll
|
||||
pub infinite_scroll_enabled: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||
|
@ -407,6 +407,7 @@ diesel::table! {
|
||||
totp_2fa_secret -> Nullable<Text>,
|
||||
totp_2fa_url -> Nullable<Text>,
|
||||
open_links_in_new_tab -> Bool,
|
||||
infinite_scroll_enabled -> Bool,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,8 @@ pub struct LocalUser {
|
||||
pub totp_2fa_url: Option<String>,
|
||||
/// Open links in a new tab.
|
||||
pub open_links_in_new_tab: bool,
|
||||
/// Whether infinite scroll is enabled.
|
||||
pub infinite_scroll_enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, TypedBuilder)]
|
||||
@ -81,6 +83,7 @@ pub struct LocalUserInsertForm {
|
||||
pub totp_2fa_secret: Option<Option<String>>,
|
||||
pub totp_2fa_url: Option<Option<String>>,
|
||||
pub open_links_in_new_tab: Option<bool>,
|
||||
pub infinite_scroll_enabled: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Clone, TypedBuilder)]
|
||||
@ -106,4 +109,5 @@ pub struct LocalUserUpdateForm {
|
||||
pub totp_2fa_secret: Option<Option<String>>,
|
||||
pub totp_2fa_url: Option<Option<String>>,
|
||||
pub open_links_in_new_tab: Option<bool>,
|
||||
pub infinite_scroll_enabled: Option<bool>,
|
||||
}
|
||||
|
@ -295,6 +295,7 @@ mod tests {
|
||||
totp_2fa_url: inserted_sara_local_user.totp_2fa_url,
|
||||
password_encrypted: inserted_sara_local_user.password_encrypted,
|
||||
open_links_in_new_tab: inserted_sara_local_user.open_links_in_new_tab,
|
||||
infinite_scroll_enabled: inserted_sara_local_user.infinite_scroll_enabled,
|
||||
},
|
||||
creator: Person {
|
||||
id: inserted_sara_person.id,
|
||||
|
@ -0,0 +1 @@
|
||||
alter table local_user drop column infinite_scroll_enabled;
|
@ -0,0 +1 @@
|
||||
alter table local_user add column infinite_scroll_enabled boolean default false not null;
|
Loading…
Reference in New Issue
Block a user