Skip to content

Commit 0bda971

Browse files
committed
remove if
1 parent d764899 commit 0bda971

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

web_src/js/modules/toast.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@ function showToast(message: string, level: Intent, {gravity, position, duration,
7777
});
7878

7979
toast.showToast();
80-
if (toast.toastElement) {
81-
const el = toast.toastElement as ToastifyElement;
82-
el.querySelector('.toast-close')!.addEventListener('click', () => toast.hideToast());
83-
el.setAttribute('data-toast-unique-key', duplicateKey);
84-
el._giteaToastifyInstance = toast;
85-
}
80+
const el = toast.toastElement as ToastifyElement;
81+
el.querySelector('.toast-close')!.addEventListener('click', () => toast.hideToast());
82+
el.setAttribute('data-toast-unique-key', duplicateKey);
83+
el._giteaToastifyInstance = toast;
8684
return toast;
8785
}
8886

0 commit comments

Comments
 (0)