Update alerts

This commit is contained in:
Bill 2022-01-03 00:11:03 -05:00
parent 97141c2fcf
commit d3908b1221
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,6 @@
import { FC, useEffect, useState } from 'react';
import { NitroLayoutFlexColumn } from '../../layout';
import { NitroLayoutBase } from '../../layout/base';
import { NotificationAlertType } from '../notification-center/common/NotificationAlertType';
import { NotificationUtilities } from '../notification-center/common/NotificationUtilities';
import { LoadingViewProps } from './LoadingView.types';
@ -14,7 +13,7 @@ export const LoadingView: FC<LoadingViewProps> = props =>
{
if(!isError) return;
NotificationUtilities.simpleAlert(message, NotificationAlertType.DEFAULT, null, null, 'Connection Error');
NotificationUtilities.simpleAlert(message, null, null, null, 'Connection Error');
}, [ isError, message ]);
useEffect(() =>

View File

@ -112,10 +112,12 @@ export class NotificationUtilities
dispatchUiEvent(new NotificationAlertEvent(messages, NotificationAlertType.MOTD, null, null, LocalizeText('notifications.motd.title')));
}
public static simpleAlert(message: string, type: string, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null): void
public static simpleAlert(message: string, type: string = null, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null): void
{
if(!title || !title.length) title = LocalizeText('notifications.broadcast.title');
if(!type || !type.length) type = NotificationAlertType.DEFAULT;
dispatchUiEvent(new NotificationAlertEvent([ this.cleanText(message) ], type, clickUrl, clickUrlText, title, imageUrl));
}