revert toastnotif edits

This commit is contained in:
thororen1234 2026-01-27 08:35:04 -05:00
parent c2300440c7
commit 715b4bef5a
No known key found for this signature in database

View file

@ -26,31 +26,12 @@ import NotificationComponent from "./NotificationComponent";
let NotificationQueue: JSX.Element[] = [];
let notificationID = 0;
let RootContainer: Root | undefined;
let ContainerEl: HTMLDivElement | undefined;
let lastPosition: string | undefined;
function getNotificationContainer() {
const currentPosition = PluginSettings.store.position || "bottom-left";
if (lastPosition && lastPosition !== currentPosition) {
try {
RootContainer?.unmount();
} catch { }
ContainerEl?.remove();
RootContainer = undefined;
ContainerEl = undefined;
NotificationQueue = [];
}
lastPosition = currentPosition;
if (!RootContainer) {
const container = document.createElement("div");
container.id = "toastnotifications-container";
document.body.append(container);
ContainerEl = container;
RootContainer = createRoot(container);
}