Skip to content

Commit

Permalink
Replace icons in a promise correctly (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Feb 24, 2024
1 parent 89af0a5 commit 6cbaffc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ const Toast = (props: ToastProps) => {
<>
{toastType || toast.icon || toast.promise ? (
<div data-icon="">
{toast.promise || toastType === 'loading'
{toast.promise && toast.type === 'loading' && !toast.icon
? toast.icon || icons?.loading || getLoadingIcon()
: toast.icon || icons?.[toastType] || getAsset(toastType)}
: null}
{toast.type !== 'loading' ? toast.icon || icons?.[toastType] || getAsset(toastType) : null}
</div>
) : null}

Expand Down Expand Up @@ -607,7 +608,7 @@ const Toaster = (props: ToasterProps) => {
data-x-position={x}
style={
{
'--front-toast-height': `${heights[0]?.height}px`,
'--front-toast-height': `${heights[0]?.height || 0}px`,
'--offset': typeof offset === 'number' ? `${offset}px` : offset || VIEWPORT_OFFSET,
'--width': `${TOAST_WIDTH}px`,
'--gap': `${GAP}px`,
Expand Down

0 comments on commit 6cbaffc

Please sign in to comment.