Skip to content

Commit 5059ba4

Browse files
committed
Return a blank "toast"
1 parent c9ab7ae commit 5059ba4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

simpletoast.js

Lines changed: 6 additions & 2 deletions
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, 6);
6+
const version = buildVersion(1, 6, 1);
77
if (window.SimpleToast) {
88
if (SimpleToast.version) {
99
if (SimpleToast.version >= version.number) return;
@@ -121,11 +121,15 @@
121121
}, 1000);
122122
}
123123

124+
const blankToast = {
125+
exists: () => false,
126+
close: () => {},
127+
};
124128
function Toast({title, text, className, css = {}, buttons, timeout}) {
125129
if (typeof arguments[0] === 'string') {
126130
text = arguments[0];
127131
}
128-
if (!text) return;
132+
if (!text) return blankToast;
129133
const id = count++;
130134
const el = document.createElement('div');
131135
if (className) {

0 commit comments

Comments
 (0)