From 19585ee11171942f096104c26045fe33727752c1 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 25 Aug 2024 13:34:43 +0300 Subject: Bring child components onto the top-level and use a single SoupSession This helps unify HTTP-related settings in one place. In Relm4 Matrix chatroom, it was said that deconstructing child components makes little sense in terms of optimizations. --- src/components/signin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/signin.rs b/src/components/signin.rs index 159711e..c595bde 100644 --- a/src/components/signin.rs +++ b/src/components/signin.rs @@ -181,7 +181,7 @@ impl AsyncComponent for SignIn { type Input = Input; type Output = Output; /// Client ID for authorizing. - type Init = glib::Uri; + type Init = (glib::Uri, soup::Session); view! { #[root] @@ -254,10 +254,10 @@ impl AsyncComponent for SignIn { sender: AsyncComponentSender, ) -> impl std::future::Future> { let model = Self { - client_id: init, + client_id: init.0, me_buffer: Default::default(), - http: soup::Session::new(), + http: init.1, callback_server: None, busy_guard: None, -- cgit 1.4.1