Rebuild all components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
This commit is contained in:
@@ -3,11 +3,10 @@ import { Tag, Mount } from "sigpro";
|
||||
|
||||
export const Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
let container = document.getElementById("sigpro-toast-container");
|
||||
|
||||
if (!container) {
|
||||
container = Tag("div", {
|
||||
id: "sigpro-toast-container",
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none",
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
@@ -16,7 +15,6 @@ export const Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
container.appendChild(toastHost);
|
||||
|
||||
let timeoutId;
|
||||
|
||||
const close = () => {
|
||||
clearTimeout(timeoutId);
|
||||
const el = toastHost.firstElementChild;
|
||||
@@ -52,10 +50,6 @@ export const Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
};
|
||||
|
||||
const instance = Mount(ToastComponent, toastHost);
|
||||
|
||||
if (duration > 0) {
|
||||
timeoutId = setTimeout(close, duration);
|
||||
}
|
||||
|
||||
if (duration > 0) timeoutId = setTimeout(close, duration);
|
||||
return close;
|
||||
};
|
||||
Reference in New Issue
Block a user