Skip to content

Commit

Permalink
fix: remove screen flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Jul 30, 2024
1 parent 7ec528a commit d1f4d92
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions crates/cassette/src/pages/cassette.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use cassette_core::{
cassette::{Cassette as CassetteData, CassetteState},
net::fetch::FetchState,
prelude::*,
task::{TaskRenderer, TaskState},
};
use patternfly_yew::prelude::*;
Expand Down Expand Up @@ -97,7 +98,7 @@ fn cassette_data(props: &DataProps) -> Html {
}

html! {
<super::PageBody {title} {subtitle} >
<super::PageBody { title } { subtitle } >
{ for contents }
</super::PageBody>
}
Expand All @@ -114,23 +115,22 @@ fn cassette_fallback(props: &FallbackProps) -> Html {
let FallbackProps { error } = props;

let title = if error.is_some() { "Error" } else { "" };
let subtitle = if error.is_some() {
None
} else {
Some("Loading...")
};

let error = props.error.as_deref().map(|error| {
html! {
<Alert inline=true title="Error" r#type={AlertType::Danger}>
{ error }
</Alert>
}
});

let content = props
.error
.as_deref()
.map(|error| {
html! {
<Alert inline=true title="Error" r#type={AlertType::Danger}>
{ error }
</Alert>
}
})
.unwrap_or_else(|| html! { <Loading /> });

html! {
<super::PageBody {title} {subtitle} >
{ for error }
<super::PageBody { title } >
{ content }
</super::PageBody>
}
}

0 comments on commit d1f4d92

Please sign in to comment.