Skip to content

Commit

Permalink
fix: Incorrect badge indicator
Browse files Browse the repository at this point in the history
Change-Id: If01dbfa7b6e2467d3a51c4f0d0b7d325c3ba09b0
  • Loading branch information
XayahSuSuSu committed Nov 3, 2024
1 parent 97bf7ae commit c9a42b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ListDataRepo @Inject constructor(
showSystemApps = MutableStateFlow(false)
userIndex = MutableStateFlow(0)
userList = usersRepo.getUsers(opType)
userMap = usersRepo.getUsersMap(opType)
userMap = usersRepo.getUsersMap(opType, cloudName, backupDir)

listData = getAppListData()
appList = appsRepo.getApps(opType = opType, listData = listData, refIds = refIds, labelIds = labelIds, cloudName = cloudName, backupDir = backupDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ class UsersRepo @Inject constructor(
OpType.RESTORE -> appsDao.queryUserIdsFlow(opType).map { it.map { u -> UserInfo(u, context.getString(R.string.user)) } }
}

fun getUsersMap(opType: OpType): Flow<Map<Int, Long>> = appsDao.countUsersMapFlow(opType = opType, blocked = false)
fun getUsersMap(opType: OpType, cloud: String, backupDir: String): Flow<Map<Int, Long>> = appsDao.countUsersMapFlow(opType = opType, blocked = false, cloud = cloud, backupDir = backupDir)
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ interface PackageDao {
@Query(
"SELECT indexInfo_userId, COUNT(*) as iCount FROM PackageEntity WHERE" +
" indexInfo_opType = :opType AND extraInfo_blocked = :blocked AND" +
" indexInfo_cloud = :cloud AND indexInfo_backupDir = :backupDir AND" +
" extraInfo_activated = 1 GROUP BY indexInfo_userId"
)
fun countUsersMapFlow(opType: OpType, blocked: Boolean):
fun countUsersMapFlow(opType: OpType, blocked: Boolean, cloud: String, backupDir: String):
Flow<Map<@MapColumn(columnName = "indexInfo_userId") Int, @MapColumn(columnName = "iCount") Long>>

@Query(
Expand Down

0 comments on commit c9a42b0

Please sign in to comment.