From ed7049048cc4d12422c07ddbaa15fbb3662c0260 Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 15 Jun 2023 17:03:53 +0300 Subject: Add support for the IndieWeb Webring πŸ•ΈπŸ’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional at first. Onboarding UI not yet exposed. --- kittybox-rs/src/frontend/mod.rs | 6 +++++- kittybox-rs/src/frontend/onboarding.rs | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'kittybox-rs/src/frontend') diff --git a/kittybox-rs/src/frontend/mod.rs b/kittybox-rs/src/frontend/mod.rs index 9d5c164..b90d57c 100644 --- a/kittybox-rs/src/frontend/mod.rs +++ b/kittybox-rs/src/frontend/mod.rs @@ -131,10 +131,13 @@ pub async fn homepage( // other requests anyway if it's serious...) // // btw is it more efficient to fetch these in parallel? - let (blogname, channels) = tokio::join!( + let (blogname, webring, channels) = tokio::join!( db.get_setting::(&path) .map(Result::unwrap_or_default), + db.get_setting::(&path) + .map(Result::unwrap_or_default), + db.get_channels(&path).map(|i| i.unwrap_or_default()) ); // Render the homepage @@ -152,6 +155,7 @@ pub async fn homepage( content: MainPage { feed: &hfeed, card: &hcard, + webring: crate::database::settings::Setting::into_inner(webring) } .to_string(), } diff --git a/kittybox-rs/src/frontend/onboarding.rs b/kittybox-rs/src/frontend/onboarding.rs index 88b533b..f797abd 100644 --- a/kittybox-rs/src/frontend/onboarding.rs +++ b/kittybox-rs/src/frontend/onboarding.rs @@ -72,6 +72,10 @@ async fn onboard( .await .map_err(FrontendError::from)?; + db.set_setting::(user.me.as_str(), false) + .await + .map_err(FrontendError::from)?; + let (_, hcard) = { let mut hcard = data.user; hcard["properties"]["uid"] = serde_json::json!([&user_uid]); -- cgit 1.4.1