mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-10 00:28:09 -05:00
fix: length of undefined on users warnings (#875)
This commit is contained in:
@@ -17,14 +17,13 @@ interface UserWarningsProps {
|
|||||||
const UserWarnings: React.FC<UserWarningsProps> = ({ onClick }) => {
|
const UserWarnings: React.FC<UserWarningsProps> = ({ onClick }) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
if (!user) {
|
//check if a user has warnings
|
||||||
|
if (!user || !user.warnings || user.warnings.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = null;
|
let res = null;
|
||||||
|
|
||||||
//check if a user has warnings
|
|
||||||
if (user.warnings.length > 0) {
|
|
||||||
user.warnings.forEach((warning) => {
|
user.warnings.forEach((warning) => {
|
||||||
let link = '';
|
let link = '';
|
||||||
let warningText = '';
|
let warningText = '';
|
||||||
@@ -57,7 +56,6 @@ const UserWarnings: React.FC<UserWarningsProps> = ({ onClick }) => {
|
|||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user