Loading app/src/main/java/foundation/e/advancedprivacy/domain/usecases/WeeklyReportUseCase.kt +6 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,12 @@ class WeeklyReportUseCase( private suspend fun addCallPerAppCandidates(candidates: MutableList<WeeklyReport>, endOfWeek: Instant) { val startOfWeek = getStartOfWeek(endOfWeek) val (appIdWithMostCalls, callsPerWeek) = statsDatabase.getCallsByAppIds(startOfWeek, endOfWeek).maxBy { it.value } val callsByAppIds = statsDatabase.getCallsByAppIds(startOfWeek, endOfWeek) if (callsByAppIds.isEmpty()) { return } val (appIdWithMostCalls, callsPerWeek) = callsByAppIds.maxBy { it.value } val app = appListRepository.getAppById(appIdWithMostCalls)?.id // TODO: get second one on fail ? Loading Loading
app/src/main/java/foundation/e/advancedprivacy/domain/usecases/WeeklyReportUseCase.kt +6 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,12 @@ class WeeklyReportUseCase( private suspend fun addCallPerAppCandidates(candidates: MutableList<WeeklyReport>, endOfWeek: Instant) { val startOfWeek = getStartOfWeek(endOfWeek) val (appIdWithMostCalls, callsPerWeek) = statsDatabase.getCallsByAppIds(startOfWeek, endOfWeek).maxBy { it.value } val callsByAppIds = statsDatabase.getCallsByAppIds(startOfWeek, endOfWeek) if (callsByAppIds.isEmpty()) { return } val (appIdWithMostCalls, callsPerWeek) = callsByAppIds.maxBy { it.value } val app = appListRepository.getAppById(appIdWithMostCalls)?.id // TODO: get second one on fail ? Loading