Skip to content

Commit

Permalink
fix: dismissable renamed to dismissible
Browse files Browse the repository at this point in the history
  • Loading branch information
tutkli committed Apr 16, 2024
1 parent 42a940b commit 8e30c20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions libs/ngx-sonner/src/lib/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createToastState() {
? data.id
: toastsCounter++;

const dismissable = data.dismissible ?? true;
const dismissible = data.dismissible ?? true;
const type = data.type ?? 'default';

const alreadyExists = toasts().find(toast => toast.id === id);
Expand All @@ -45,15 +45,15 @@ function createToastState() {
...data,
id,
title: message,
dismissible: dismissable,
dismissible,
type,
updated: true,
};
} else return { ...toast, updated: false };
})
);
} else {
addToast({ ...rest, id, title: message, dismissible: dismissable, type });
addToast({ ...rest, id, title: message, dismissible: dismissible, type });
}

return id;
Expand Down
2 changes: 1 addition & 1 deletion libs/ngx-sonner/src/tests/toaster.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ describe('Toaster', () => {
expect(closeButton).not.toBeNull();
});

it('should not show close button if the toast is not dismissable', async () => {
it('should not show close button if the toast is not dismissible', async () => {
const { user, trigger, container } = await setup({
callback: toast => toast('Hello world', { dismissible: false }),
closeButton: true,
Expand Down

0 comments on commit 8e30c20

Please sign in to comment.