Skip to content

Commit 467ca18

Browse files
committed
Prevent progress snackbars from being auto-discarded
1 parent a8801fa commit 467ca18

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

ts/WoltLabSuite/Core/Component/Snackbar.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,10 @@ class SnackbarContainer {
173173
}
174174

175175
addSnackbar(snackbar: Snackbar): void {
176-
if (this.#snackbars.length > 2) {
177-
const oldSnackbar = this.#snackbars.shift();
178-
oldSnackbar?.close();
176+
const existingStaticSnackbars = this.#snackbars.filter((snackbar) => !snackbar.isProgress());
177+
if (existingStaticSnackbars.length > 2) {
178+
const oldSnackbar = existingStaticSnackbars.shift();
179+
oldSnackbar!.close();
179180
}
180181

181182
this.#snackbars.push(snackbar);

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Snackbar.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)