mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 19:36:08 +03:00
Clean code
This commit is contained in:
parent
54daee2798
commit
9b75da5d4d
1 changed files with 5 additions and 5 deletions
|
@ -42,15 +42,16 @@ class ShortcutsHandler @Inject constructor(
|
||||||
return Disposables.empty()
|
return Disposables.empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
return activeSessionHolder.getSafeActiveSession()
|
val session = activeSessionHolder.getSafeActiveSession() ?: return Disposables.empty()
|
||||||
?.getPagedRoomSummariesLive(
|
return session
|
||||||
|
.getPagedRoomSummariesLive(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
memberships = listOf(Membership.JOIN)
|
memberships = listOf(Membership.JOIN)
|
||||||
},
|
},
|
||||||
sortOrder = RoomSortOrder.PRIORITY_AND_ACTIVITY
|
sortOrder = RoomSortOrder.PRIORITY_AND_ACTIVITY
|
||||||
)
|
)
|
||||||
?.asObservable()
|
.asObservable()
|
||||||
?.subscribe { rooms ->
|
.subscribe { rooms ->
|
||||||
// Remove dead shortcuts (i.e. deleted rooms)
|
// Remove dead shortcuts (i.e. deleted rooms)
|
||||||
val roomIds = rooms.map { it.roomId }
|
val roomIds = rooms.map { it.roomId }
|
||||||
val deadShortcutIds = ShortcutManagerCompat.getShortcuts(context, ShortcutManagerCompat.FLAG_MATCH_DYNAMIC)
|
val deadShortcutIds = ShortcutManagerCompat.getShortcuts(context, ShortcutManagerCompat.FLAG_MATCH_DYNAMIC)
|
||||||
|
@ -66,7 +67,6 @@ class ShortcutsHandler @Inject constructor(
|
||||||
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
|
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?: Disposables.empty()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearShortcuts() {
|
fun clearShortcuts() {
|
||||||
|
|
Loading…
Reference in a new issue