fix some crashes
This commit is contained in:
@@ -114,6 +114,8 @@ export async function fetchLastMonitoringCheck() {
|
|||||||
|
|
||||||
if (parsed?.message_body?.searches_by_status) {
|
if (parsed?.message_body?.searches_by_status) {
|
||||||
return parsed.message_body;
|
return parsed.message_body;
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ export async function getViolationFilesArray(props: {
|
|||||||
file_name?: string
|
file_name?: string
|
||||||
}) {
|
}) {
|
||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
console.log('getViolationFilesArray');
|
|
||||||
const { page, size, start_date, end_date, file_name } = props;
|
const { page, size, start_date, end_date, file_name } = props;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export default function DashboardUserViolations() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{violationData?.content.length ? (
|
{violationData?.content?.length ? (
|
||||||
violationData?.content.map((file) => {
|
violationData?.content.map((file) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -147,19 +147,13 @@ export default function NotificationsButton() {
|
|||||||
<svg viewBox="0 0 24 24" fill="currentColor" style={{ width: "20px", height: "20px" }}>
|
<svg viewBox="0 0 24 24" fill="currentColor" style={{ width: "20px", height: "20px" }}>
|
||||||
<path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"></path>
|
<path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"></path>
|
||||||
</svg>
|
</svg>
|
||||||
{(notificationList?.unreadCount !== 0 && notificationList?.unreadCount !== undefined) ? (
|
{(notificationList?.unreadCount !== 0 && notificationList?.unreadCount !== undefined) && (
|
||||||
<span
|
<span
|
||||||
className="notification-unread-count"
|
className="notification-unread-count"
|
||||||
/* style={{ fontSize: getFontSizeByCount(notificationList?.unreadCount) }} */
|
/* style={{ fontSize: getFontSizeByCount(notificationList?.unreadCount) }} */
|
||||||
>
|
>
|
||||||
{notificationList?.unreadCount > 9 ? '9+' : notificationList?.unreadCount}
|
{notificationList?.unreadCount > 9 ? '9+' : notificationList?.unreadCount}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
|
||||||
<span
|
|
||||||
className="notification-unread-count"
|
|
||||||
>
|
|
||||||
0
|
|
||||||
</span>
|
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
<div className={`notification-dropdown ${isOpen ? 'show' : ''}`}>
|
<div className={`notification-dropdown ${isOpen ? 'show' : ''}`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user