1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix remaining any type warnings

This commit is contained in:
Bill Thornton 2022-02-28 09:58:52 -05:00
parent 76b633b62d
commit b31060bbeb
3 changed files with 30 additions and 7 deletions

View file

@ -26,10 +26,10 @@ const createButtonElement = () => ({
});
type IProps = {
user?: Record<string, any>;
user?: UserDto;
}
const getLastSeenText = (lastActivityDate?: string) => {
const getLastSeenText = (lastActivityDate?: string | null) => {
if (lastActivityDate) {
return globalize.translate('LastSeen', formatDistanceToNow(Date.parse(lastActivityDate), localeWithSuffix));
}
@ -37,16 +37,16 @@ const getLastSeenText = (lastActivityDate?: string) => {
return '';
};
const UserCardBox: FunctionComponent<IProps> = ({ user = [] }: IProps) => {
const UserCardBox: FunctionComponent<IProps> = ({ user = {} }: IProps) => {
let cssClass = 'card squareCard scalableCard squareCard-scalable';
if (user.Policy.IsDisabled) {
if (user.Policy?.IsDisabled) {
cssClass += ' grayscale';
}
let imgUrl;
if (user.PrimaryImageTag) {
if (user.PrimaryImageTag && user.Id) {
imgUrl = window.ApiClient.getUserImageUrl(user.Id, {
width: 300,
tag: user.PrimaryImageTag,
@ -56,7 +56,7 @@ const UserCardBox: FunctionComponent<IProps> = ({ user = [] }: IProps) => {
let imageClass = 'cardImage';
if (user.Policy.IsDisabled) {
if (user.Policy?.IsDisabled) {
imageClass += ' disabledUser';
}