vanilla-jui 1.5.9 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-jui",
3
- "version": "1.5.9",
3
+ "version": "1.5.10",
4
4
  "private": false,
5
5
  "description": "A lightweight, reactive, and fully customizable vanilla JS UI library.",
6
6
  "keywords": [
@@ -156,9 +156,10 @@ async function closeByUser(
156
156
  toast: HTMLElement,
157
157
  options: ToastOptions
158
158
  ): Promise<void> {
159
- if (isToastLoading(options)) await options.onCancel?.();
160
- await options.onClose?.();
159
+ const shouldCancel = isToastLoading(options);
161
160
  hide(toast);
161
+ if (shouldCancel) await options.onCancel?.();
162
+ await options.onClose?.();
162
163
  }
163
164
 
164
165
  function bindToastStatus(