mirror of
https://github.com/Nutomic/ibis.git
synced 2024-12-23 20:01:23 +00:00
remove dead code
This commit is contained in:
parent
117323a5e3
commit
7a1da4fd34
2 changed files with 1 additions and 10 deletions
|
@ -22,19 +22,11 @@ use reqwest::Client;
|
|||
// https://book.leptos.dev/15_global_state.html
|
||||
#[derive(Clone)]
|
||||
pub struct GlobalState {
|
||||
// TODO: remove
|
||||
backend_hostname: String,
|
||||
api_client: ApiClient,
|
||||
pub(crate) my_profile: Option<LocalUserView>,
|
||||
}
|
||||
|
||||
impl GlobalState {
|
||||
pub fn read_hostname() -> String {
|
||||
use_context::<RwSignal<GlobalState>>()
|
||||
.expect("backend hostname is provided")
|
||||
.get_untracked()
|
||||
.backend_hostname
|
||||
}
|
||||
pub fn api_client() -> ApiClient {
|
||||
use_context::<RwSignal<GlobalState>>()
|
||||
.expect("global state is provided")
|
||||
|
@ -60,7 +52,6 @@ pub fn App() -> impl IntoView {
|
|||
|
||||
provide_meta_context();
|
||||
let backend_hostname = GlobalState {
|
||||
backend_hostname: backend_hostname.clone(),
|
||||
api_client: ApiClient::new(Client::new(), backend_hostname.clone()),
|
||||
my_profile: None,
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ use leptos_router::*;
|
|||
#[component]
|
||||
pub fn ArticleHistory() -> impl IntoView {
|
||||
let params = use_params_map();
|
||||
let title = params.get().get("title").cloned();
|
||||
let title = params.get_untracked().get("title").cloned();
|
||||
let article = article_resource(title.unwrap());
|
||||
|
||||
view! {
|
||||
|
|
Loading…
Reference in a new issue