Skip to content

Commit 1025a12

Browse files
authored
fix: window binding being greedy
1 parent f2fbaae commit 1025a12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

simpletoast.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
const localToast = factory();
99
root.SimpleToast = localToast;
1010
console.log(`SimpleToast(v${localToast.versionString}): Loaded`);
11-
// Apply to window if SimpleToast doesn't currently exist
12-
if (root !== window && !(boundToast instanceof localToast)) {
11+
// Apply to window if SimpleToast doesn't exist or is outdated
12+
if (root !== window && (!boundToast?.version || boundToast.version < localToast.version)) {
1313
window.SimpleToast = localToast;
1414
console.log(`SimpleToast(v${localToast.versionString}): Publicized`);
1515
}
1616
})(this, () => {
17-
const version = buildVersion(2, 0, 0);
17+
const version = buildVersion(2, 0, 1);
1818
const style = {
1919
root: {
2020
display: 'flex',

0 commit comments

Comments
 (0)