Skip to content

Commit 6d43c76

Browse files
committed
- Remove duplicated code from ProfileDataObtainmentCell
- Lower the available percentage of both Disk and RAM Coil is allowed to use in order to cache its assets
1 parent 071bf9e commit 6d43c76

File tree

2 files changed

+9
-15
lines changed
  • app/src/main/kotlin/githubprofilesearcher/caiodev/com/br/githubprofilesearcher
  • modules/common/midfield/features/profile/src/main/kotlin/githubprofilesearcher/caiodev/com/br/githubprofilesearcher/midfield/profile/cell

2 files changed

+9
-15
lines changed

app/src/main/kotlin/githubprofilesearcher/caiodev/com/br/githubprofilesearcher/App.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class App : Application(), ImageLoaderFactory {
4343

4444
companion object {
4545
private const val COIL_CACHE_DIR = "coil_image_cache"
46-
private const val DISK_CACHE_CAP = .05
47-
private const val MEMORY_CACHE_CAP = .2
46+
private const val DISK_CACHE_CAP = .01
47+
private const val MEMORY_CACHE_CAP = .05
4848
}
4949
}

modules/common/midfield/features/profile/src/main/kotlin/githubprofilesearcher/caiodev/com/br/githubprofilesearcher/midfield/profile/cell/ProfileDataObtainmentCell.kt

+7-13
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,16 @@ internal class ProfileDataObtainmentCell(
6666
if (shouldListBeCleared) {
6767
userDatabaseRepository.drop()
6868
userDatabaseRepository.insert(profileList = it.profileList.mapToEntity())
69-
profileList.addAll(userDatabaseRepository.get())
70-
executePostUserInfoArrival()
71-
ProfileState(
72-
isSuccess = true,
73-
isSuccessWithContent = true,
74-
content = profileList.mapFromEntity(),
75-
)
7669
} else {
7770
userDatabaseRepository.upsert(profileList = it.profileList.mapToEntity())
78-
profileList.addAll(userDatabaseRepository.get())
79-
ProfileState(
80-
isSuccess = true,
81-
isSuccessWithContent = true,
82-
content = profileList.mapFromEntity(),
83-
)
8471
}
72+
profileList.addAll(userDatabaseRepository.get())
73+
executePostUserInfoArrival()
74+
ProfileState(
75+
isSuccess = true,
76+
isSuccessWithContent = true,
77+
content = profileList.mapFromEntity(),
78+
)
8579
} else {
8680
ProfileState(
8781
errorMessage = string.client_side,

0 commit comments

Comments
 (0)