Skip to content

Commit 8b998dc

Browse files
committed
fix: dismiss current toast before adding a new one to the queue
1 parent 7dcc317 commit 8b998dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class ToastQueueManager(private val scope: CoroutineScope) {
4040
* Add toast to queue. If queue is full, drops oldest.
4141
*/
4242
fun enqueue(toast: Toast) {
43+
dismissCurrentToast()
4344
_queue.update { current ->
4445
val newQueue = if (current.size >= MAX_QUEUE_SIZE) {
4546
// Drop oldest (first item) when queue full
@@ -49,8 +50,6 @@ class ToastQueueManager(private val scope: CoroutineScope) {
4950
}
5051
newQueue
5152
}
52-
53-
dismissCurrentToast()
5453
}
5554

5655
/**

0 commit comments

Comments
 (0)