Skip to content

Commit

Permalink
fix: unmount custom loading icon correctly (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbsdickson authored Mar 10, 2024
1 parent 6b37985 commit 4088630
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const Toast = (props: ToastProps) => {
function getLoadingIcon() {
if (icons?.loading) {
return (
<div className="loader" data-visible={toastType === 'loading'}>
<div className="sonner-loader" data-visible={toastType === 'loading'}>
{icons.loading}
</div>
);
Expand Down Expand Up @@ -366,7 +366,7 @@ const Toast = (props: ToastProps) => {
{toastType || toast.icon || toast.promise ? (
<div data-icon="">
{toast.promise || (toast.type === 'loading' && !toast.icon)
? toast.icon || icons?.loading || getLoadingIcon()
? toast.icon || getLoadingIcon()
: null}
{toast.type !== 'loading' ? toast.icon || icons?.[toastType] || getAsset(toastType) : null}
</div>
Expand Down

0 comments on commit 4088630

Please sign in to comment.