Check calendar permission in CalendarRepositoryImpl::getUpcomingEvents
This commit is contained in:
parent
ff0aafa41a
commit
8ce84cfe22
@ -156,6 +156,9 @@ class CalendarRepositoryImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getUpcomingEvents(): Flow<List<CalendarEvent>> = channelFlow {
|
override fun getUpcomingEvents(): Flow<List<CalendarEvent>> = channelFlow {
|
||||||
|
val hasPermission = permissionsManager.hasPermission(PermissionGroup.Calendar)
|
||||||
|
hasPermission.collectLatest {
|
||||||
|
if (it) {
|
||||||
dataStore.data.map { it.calendarWidget }.collectLatest { settings ->
|
dataStore.data.map { it.calendarWidget }.collectLatest { settings ->
|
||||||
hiddenItems.collectLatest { hidden ->
|
hiddenItems.collectLatest { hidden ->
|
||||||
val now = System.currentTimeMillis()
|
val now = System.currentTimeMillis()
|
||||||
@ -175,6 +178,10 @@ class CalendarRepositoryImpl(
|
|||||||
send(events)
|
send(events)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
send(emptyList())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun getCalendars(): List<UserCalendar> {
|
override suspend fun getCalendars(): List<UserCalendar> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user