Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e48861e7 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Merge branch '0000-fix_sentry_issues' into 'main'

0000 fix sentry issues

See merge request !200
parents 67b57bb1 c365a016
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 ?
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ class DebugWeeklyReportFragment : Fragment(R.layout.debug_weekly_report_fragment
        val timestamp = Instant.now()

        // Call Per App
        val anyApp = appListRepository.displayableApps.value.first()
        val anyApp = appListRepository.displayableApps.value.firstOrNull() ?: return emptyList()
        val callsPerWeek = Random.nextInt(10000)

        val hoursInWeek = 7 * 24