fix: allow for prevent default in toast notification

This commit is contained in:
tlkh40 2022-06-29 18:49:57 +07:00 committed by GitHub
commit 14fda259e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,8 +43,10 @@
let timeoutId = undefined; let timeoutId = undefined;
function close(closeFromTimeout) { function close(closeFromTimeout) {
open = false; const shouldContinue = dispatch("close", { timeout: closeFromTimeout === true }, { cancelable: true });
dispatch("close", { timeout: closeFromTimeout === true }); if (shouldContinue) {
open = false;
}
} }
onMount(() => { onMount(() => {