Changes to use display over transient property

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2022-10-24 11:05:02 -05:00
parent 66f74acaee
commit 9777aa5098
4 changed files with 14 additions and 14 deletions
@@ -64,7 +64,7 @@ export function AlertDisplay(props: AlertDisplayProps) {
useEffect(() => {
const [current] = messages;
if (current && current.transient)
if (current && current.display === 'transient')
setTimeout(() => {
setMessages(msgs => msgs.filter(msg => msg !== current));
}, timeoutMs);
+1 -1
View File
@@ -29,7 +29,7 @@ export const alertApiRef: ApiRef<AlertApi>;
export type AlertMessage = {
message: string;
severity?: 'success' | 'info' | 'warning' | 'error';
transient?: boolean;
display?: 'permanent' | 'transient';
};
// @public
@@ -26,7 +26,7 @@ export type AlertMessage = {
message: string;
// Severity will default to success since that is what material ui defaults the value to.
severity?: 'success' | 'info' | 'warning' | 'error';
transient?: boolean;
display?: 'permanent' | 'transient';
};
/**