Skip to content

Conversation

BijinDev
Copy link
Contributor

No description provided.

@BijinDev BijinDev linked an issue Aug 20, 2025 that may be closed by this pull request
10 tasks
@BijinDev BijinDev force-pushed the 9534-snakbar-hovered branch 2 times, most recently from 3886f16 to 1795628 Compare August 21, 2025 11:35
@@ -164,6 +181,11 @@ function showNextNotification() {
let closed = false

const closeAndOpenNext = (timedOut: boolean) => {
if (timedOut && hovered) {
debounce(1000, closeAndOpenNext)(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think of using a throw-away debounce() as a way to do setTimeout() 😅 not sure how I feel about it (actually I was now that it is also used this way in this file, weird).

Either way, if you schedule closeAndOpenNext() and then user manually closes it and then the timeout fires it might get into a weird state. closeFunction() might try to close the original snackbar, but the queue shift will remove another one from it.

Maybe I'm wrong also but this is from a quick glance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think of using a throw-away debounce() as a way to do setTimeout() 😅 not sure how I feel about it (actually I was now that it is also used this way in this file, weird).

We did actually use setTimeout at first but then switched it to a debounce after we saw the one you mentioned 😅

Either way, if you schedule closeAndOpenNext() and then user manually closes it and then the timeout fires it might get into a weird state. closeFunction() might try to close the original snackbar, but the queue shift will remove another one from it.

Good point! we'll fix it :)

@hrb-hub hrb-hub force-pushed the dev-mail branch 2 times, most recently from 3f612e3 to baadc75 Compare August 29, 2025 08:59
BijinDev and others added 2 commits September 1, 2025 16:15
@hrb-hub hrb-hub force-pushed the 9534-snakbar-hovered branch from 1795628 to 7c37443 Compare September 1, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't timeout snackBar if it is hovered.
3 participants