export async function saveUserSettingsBio(api: API): Promise<LoginResponse> {
let form: SaveUserSettings = {
show_nsfw: true,
+ blur_nsfw: false,
+ auto_expand: true,
theme: "darkly",
default_sort_type: "Active",
default_listing_type: "All",
let bio = "a changed bio";
let form: SaveUserSettings = {
show_nsfw: false,
+ blur_nsfw: true,
+ auto_expand: false,
default_sort_type: "Hot",
default_listing_type: "All",
interface_language: "",
.show_new_post_notifs(data.show_new_post_notifs)
.send_notifications_to_email(data.send_notifications_to_email)
.show_nsfw(data.show_nsfw)
+ .blur_nsfw(data.blur_nsfw)
+ .auto_expand(data.auto_expand)
.show_bot_accounts(data.show_bot_accounts)
.show_scores(data.show_scores)
.default_sort_type(default_sort_type)
pub struct SaveUserSettings {
/// Show nsfw posts.
pub show_nsfw: Option<bool>,
+ pub blur_nsfw: Option<bool>,
+ pub auto_expand: Option<bool>,
/// Show post and comment scores.
pub show_scores: Option<bool>,
/// Your user's theme.
totp_2fa_secret -> Nullable<Text>,
totp_2fa_url -> Nullable<Text>,
open_links_in_new_tab -> Bool,
+ blur_nsfw -> Bool,
+ auto_expand -> Bool,
infinite_scroll_enabled -> Bool,
}
}
pub totp_2fa_url: Option<String>,
/// Open links in a new tab.
pub open_links_in_new_tab: bool,
+ pub blur_nsfw: bool,
+ pub auto_expand: bool,
/// Whether infinite scroll is enabled.
pub infinite_scroll_enabled: bool,
}
pub totp_2fa_secret: Option<Option<String>>,
pub totp_2fa_url: Option<Option<String>>,
pub open_links_in_new_tab: Option<bool>,
+ pub blur_nsfw: Option<bool>,
+ pub auto_expand: Option<bool>,
pub infinite_scroll_enabled: Option<bool>,
}
pub totp_2fa_secret: Option<Option<String>>,
pub totp_2fa_url: Option<Option<String>>,
pub open_links_in_new_tab: Option<bool>,
+ pub blur_nsfw: Option<bool>,
+ pub auto_expand: Option<bool>,
pub infinite_scroll_enabled: Option<bool>,
}
person_id: inserted_sara_local_user.person_id,
email: inserted_sara_local_user.email,
show_nsfw: inserted_sara_local_user.show_nsfw,
+ auto_expand: inserted_sara_local_user.auto_expand,
+ blur_nsfw: inserted_sara_local_user.blur_nsfw,
theme: inserted_sara_local_user.theme,
default_sort_type: inserted_sara_local_user.default_sort_type,
default_listing_type: inserted_sara_local_user.default_listing_type,
--- /dev/null
+alter table local_user drop column blur_nsfw;
+alter table local_user drop column auto_expand;
--- /dev/null
+
+-- Add the blur_nsfw to the local user table as a setting
+alter table local_user add column blur_nsfw boolean not null default true;
+
+-- Add the auto_expand to the local user table as a setting
+alter table local_user add column auto_expand boolean not null default false;