Skip to content

Commit ace54c7

Browse files
committed
Add function to check toast existence
1 parent 3e7df3c commit ace54c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

simpletoast.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
(() => {
55
if (window !== window.top) return;
6-
const version = buildVersion(1, 4, 1);
6+
const version = buildVersion(1, 5);
77
if (window.SimpleToast) {
88
if (SimpleToast.version) {
99
if (SimpleToast.version >= version.number) return;
@@ -147,6 +147,7 @@
147147
body.textContent = text;
148148
el.appendChild(body);
149149
const toast = {
150+
exists: () => toasts.has(id),
150151
close: () => {
151152
root.removeChild(el);
152153
toasts.delete(id);

0 commit comments

Comments
 (0)