Skip to content

Commit

Permalink
partial fix #858 #952
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed May 14, 2023
1 parent d9e8c13 commit 2b7ff7b
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/utils/mapper.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { Toast, ToastItem, ToastItemStatus } from '../types';

export function toToastItem(toast: Toast, status: ToastItemStatus): ToastItem {
return {
content: toast.content,
containerId: toast.props.containerId,
id: toast.props.toastId,
theme: toast.props.theme,
type: toast.props.type,
data: toast.props.data || {},
isLoading: toast.props.isLoading,
icon: toast.props.icon,
status
};
return toast != null
? {
content: toast.content,
containerId: toast.props.containerId,
id: toast.props.toastId,
theme: toast.props.theme,
type: toast.props.type,
data: toast.props.data || {},
isLoading: toast.props.isLoading,
icon: toast.props.icon,
status
}
: // monkey patch for now
({} as ToastItem);
}

0 comments on commit 2b7ff7b

Please sign in to comment.