Skip to content

Commit

Permalink
Simplify getting user from session
Browse files Browse the repository at this point in the history
  • Loading branch information
Zokhoi committed Nov 6, 2023
1 parent 706e794 commit c216569
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions deepwell/src/services/view/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,7 @@ impl ViewService {
let user = match user_ref {
Some(user_ref) => UserService::get_optional(ctx, user_ref).await?,
// For users visiting their own user info page
None => match &viewer.user_session {
Some(user_session) => Some(user_session.user.clone()),
None => None,
},
None => viewer.user_session.clone().and_then(|session| Some(session.user)),
};

let output = match user {
Expand Down

0 comments on commit c216569

Please sign in to comment.