fix: Add a little guard there.

Changed files
+6 -5
client
src
lumina_client
+6 -5
client/src/lumina_client/view/homepage.gleam
··· 42 42 import lustre/attribute.{attribute} 43 43 import lustre/element.{type Element} 44 44 import lustre/element/html 45 - import lustre/element/svg 46 45 import lustre/event 47 46 48 47 fn closemodal_not_for_modal_box() { ··· 53 52 } 54 53 } 55 54 56 - pub fn view(model: model_type.Model) { 55 + pub fn view(model: model_type.Model) -> Element(Msg) { 57 56 // Dissect the model 58 57 let assert model_type.Model( 59 58 page: model_type.HomeTimeline(timeline_name:, modal:), 60 59 user:, 61 60 .., 62 61 ) = model 62 + use <- 63 + bool.lazy_guard(option.is_some(user), _, fn() { 64 + element.text("Loading user...") 65 + }) 63 66 let assert Some(user) = user 64 - as "User must be logged in to see homepage, got None from model where a user-submodel was expected." 65 - 67 + as "User must be logged in to see homepage, got None from model where a user-submodel was expected. (Got past a guard?)" 66 68 let timeline_name = option.unwrap(timeline_name, "global") 67 69 let modal_element = case 68 70 modal |> option.map(modal_by_id(_, model)) |> option.unwrap(NoModal) ··· 128 130 html.div( 129 131 [ 130 132 attribute.id(id), 131 - 132 133 attribute.class( 133 134 "modal-box lg:freeroam flex flex-col justify-center items-center bg-base-100 shadow-2xl w-[99vw] lg:w-[32rem] max-w-[unset] lg:max-w-[99vw] h-[80lvh] lg:h-[80lvh] lg:max-h-[90vh] relative lg:absolute", 134 135 ),