Skip to content

Commit 5a7dd1f

Browse files
committed
chore: remove queue size logic
1 parent 9e10120 commit 5a7dd1f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ class ToastQueueManager(private val scope: CoroutineScope) {
3131
private val _currentToast = MutableStateFlow<Toast?>(null)
3232
val currentToast: StateFlow<Toast?> = _currentToast.asStateFlow()
3333

34-
private val _queueSize = MutableStateFlow(0)
35-
val queueSize: StateFlow<Int> = _queueSize.asStateFlow()
36-
3734
// Internal queue state
3835
private val _queue = MutableStateFlow<List<Toast>>(emptyList())
3936
private var timerJob: Job? = null
@@ -50,7 +47,6 @@ class ToastQueueManager(private val scope: CoroutineScope) {
5047
} else {
5148
current + toast
5249
}
53-
_queueSize.value = newQueue.size
5450
newQueue
5551
}
5652
// If no toast is currently displayed, show this one immediately
@@ -97,7 +93,6 @@ class ToastQueueManager(private val scope: CoroutineScope) {
9793
fun clear() {
9894
cancelTimer()
9995
_queue.value = emptyList()
100-
_queueSize.value = 0
10196
_currentToast.value = null
10297
isPaused = false
10398
}
@@ -110,7 +105,6 @@ class ToastQueueManager(private val scope: CoroutineScope) {
110105

111106
// Remove from queue
112107
_queue.update { it.drop(1) }
113-
_queueSize.value = _queue.value.size
114108

115109
// Display toast
116110
_currentToast.value = nextToast

0 commit comments

Comments
 (0)