๐Ÿ“ˆ SPA for bank credit score analysis
lustre frontent oat-ui gleam
0

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ’ก add labels

author
kacaii.dev
date (May 15, 2026, 6:20 PM -0300) commit 73c59530 parent 35045e50 change-id wpzzswyt
+9 -9
+8 -8
src/client.gleam
··· 52 52 53 53 pub type Msg { 54 54 /// Handle internal links navigation 55 - UserNavigatedTo(to: route.Route) 55 + UserNavigatedTo(route: route.Route) 56 56 /// User sent a request to the Server during startup to verify if the current 57 57 /// token is still valid. 58 58 UserRestoredSession(result: Result(session.Session, rsvp.Error(String))) ··· 155 155 pub fn update(model: Model, msg: Msg) -> #(Model, Effect(Msg)) { 156 156 case model, msg { 157 157 // ๏‰ธ NAVIGATION 158 - model, UserNavigatedTo(route) -> handle_navigation(model, route) 158 + model, UserNavigatedTo(route:) -> handle_navigation(model, route) 159 159 160 160 // ๏’„ LANGUAGE SELECTION 161 - model, NavbarMsg(navbar.UserSelectedLanguage(lang)) -> #( 161 + model, NavbarMsg(msg: navbar.UserSelectedLanguage(lang:)) -> #( 162 162 Model(..model, lang:), 163 163 effect.none(), 164 164 ) ··· 168 168 // If the Server successfully authenticated the User, 169 169 // initialize its Session, and redirect them to the correct route. 170 170 Model(session: session.Pending(on_success:, ..), ..), 171 - UserRestoredSession(Ok(session)) 171 + UserRestoredSession(result: Ok(session)) 172 172 -> #( 173 173 Model(..model, session:, route: on_success, page: page.init(on_success)), 174 174 modem.push(route.path(on_success), option.None, option.None), ··· 177 177 // If it fails, start the Session as a Guest and redirect 178 178 // the User accordingly, usually to the Login Page. 179 179 Model(session: session.Pending(on_failure:, ..), ..), 180 - UserRestoredSession(Error(..)) 180 + UserRestoredSession(result: Error(..)) 181 181 -> { 182 182 let session = session.Guest 183 183 let route = on_failure ··· 188 188 189 189 // User ended their Session and token has been removed. 190 190 // Redirect user to the Home page. 191 - model, ServerRemovedToken(Ok(..)) -> { 191 + model, ServerRemovedToken(result: Ok(..)) -> { 192 192 let session = session.Guest 193 193 let route = route.path(route.Home) 194 194 ··· 245 245 // ๏‹ƒ Server successfully authenticated the Client, we can now store 246 246 // the returned Session token in our application Model and access 247 247 // protected routes. 248 - login.ServerAuthenticatedUser(session) -> #( 248 + login.ServerAuthenticatedUser(session:) -> #( 249 249 Model(..model, session:), 250 250 route.Dashboard 251 251 |> route.path ··· 254 254 255 255 // ๏‘ฎ Server failed to authenticate the Client, display a error message 256 256 // on the Login page and continue execution. 257 - login.ServerFailedToAuthenticate(reason) -> { 257 + login.ServerFailedToAuthenticate(reason:) -> { 258 258 let message = case reason { 259 259 rsvp.HttpError(resp) -> resp.body 260 260
+1 -1
src/client/session.gleam
··· 5 5 pub type Session { 6 6 /// ๏‹ƒ User is sucessfully authenticated and is allowed to 7 7 /// access protected routes. 8 - Authenticated(token.Token) 8 + Authenticated(token: token.Token) 9 9 /// ๏„ User is waiting for the Server to validate their credentials 10 10 /// and will be redirected on success / failure. 11 11 Pending(on_success: route.Route, on_failure: route.Route)