提交 d10a4f49 编写于 作者: B Benjamin Pasero

notifications - remove toasts from DOM that are not visible

上级 2b577085
......@@ -466,10 +466,18 @@ export class NotificationsToasts extends Themable {
}
private setVisibility(toast: INotificationToast, visible: boolean): void {
toast.container.style.display = visible ? 'block' : 'none';
if (this.isVisible(toast) === visible) {
return;
}
if (visible) {
this.notificationsToastsContainer.appendChild(toast.container);
} else {
this.notificationsToastsContainer.removeChild(toast.container);
}
}
private isVisible(toast: INotificationToast): boolean {
return toast.container.style.display === 'block';
return !!toast.container.parentElement;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册