Fix session user avatar display

rust
Elnu 1 year ago
parent 4970ffd845
commit e18c31999a

@ -129,7 +129,9 @@ impl SessionUser {
USER_DISCRIMINATOR_COOKIE,
user.discriminator.to_string(),
));
cookies.add_private(Cookie::new(USER_AVATAR_COOKIE, user.avatar()));
if let Some(avatar) = &user.avatar {
cookies.add_private(Cookie::new(USER_AVATAR_COOKIE, avatar.clone()));
}
Ok(Self(user))
}
@ -147,7 +149,7 @@ impl SessionUser {
id: parse_cookie_value(cookies, USER_ID_COOKIE)?,
name: parse_cookie_value(cookies, USER_NAME_COOKIE)?,
discriminator: parse_cookie_value(cookies, USER_DISCRIMINATOR_COOKIE)?,
avatar: Some(parse_cookie_value(cookies, USER_AVATAR_COOKIE)?),
avatar: parse_cookie_value(cookies, USER_AVATAR_COOKIE),
deleted: false,
}))
}

Loading…
Cancel
Save