Skip to content

Commit 020839f

Browse files
committed
Simplify again the code.
1 parent 9a461f4 commit 020839f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotificationDrawerManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class DefaultNotificationDrawerManager @Inject constructor(
224224
doRender: Boolean,
225225
action: (NotificationEventQueue) -> Unit,
226226
) {
227-
notificationState.updateQueuedEvents(this) { queuedEvents, _ ->
227+
notificationState.updateQueuedEvents { queuedEvents, _ ->
228228
action(queuedEvents)
229229
}
230230
coroutineScope.refreshNotificationDrawer(doRender)
@@ -247,7 +247,7 @@ class DefaultNotificationDrawerManager @Inject constructor(
247247

248248
private suspend fun refreshNotificationDrawerBg(doRender: Boolean) {
249249
Timber.v("refreshNotificationDrawerBg()")
250-
val eventsToRender = notificationState.updateQueuedEvents(this) { queuedEvents, renderedEvents ->
250+
val eventsToRender = notificationState.updateQueuedEvents { queuedEvents, renderedEvents ->
251251
notifiableEventProcessor.process(queuedEvents.rawEvents(), renderedEvents).also {
252252
queuedEvents.clearAndAdd(it.onlyKeptEvents())
253253
}

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotificationState.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ class NotificationState(
3939
) {
4040

4141
fun <T> updateQueuedEvents(
42-
drawerManager: DefaultNotificationDrawerManager,
43-
action: DefaultNotificationDrawerManager.(NotificationEventQueue, List<ProcessedEvent<NotifiableEvent>>) -> T
42+
action: (NotificationEventQueue, List<ProcessedEvent<NotifiableEvent>>) -> T
4443
): T {
4544
return synchronized(queuedEvents) {
46-
action(drawerManager, queuedEvents, renderedEvents)
45+
action(queuedEvents, renderedEvents)
4746
}
4847
}
4948

0 commit comments

Comments
 (0)