Skip to content

Commit ae3fc21

Browse files
authored
dashboard: smoother mylibrary realm handling (fixes #9033) (#9011)
1 parent b6c762f commit ae3fc21

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
applicationId "org.ole.planet.myplanet"
1010
minSdk = 26
1111
targetSdk = 36
12-
versionCode = 3720
13-
versionName = "0.37.20"
12+
versionCode = 3721
13+
versionName = "0.37.21"
1414
ndkVersion = '26.3.11579264'
1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
vectorDrawables.useSupportLibrary = true

app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragment.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ open class BaseDashboardFragment : BaseDashboardFragmentPlugin(), NotificationCa
140140
}
141141

142142
private suspend fun myLibraryDiv(view: View) {
143-
val dbMylibrary = withContext(Dispatchers.IO) {
144-
Realm.getDefaultInstance().use { realm ->
145-
val results = RealmMyLibrary.getMyLibraryByUserId(realm, settings)
146-
realm.copyFromRealm(results)
147-
}
143+
val dbMylibrary = databaseService.withRealmAsync { realm ->
144+
val results = RealmMyLibrary.getMyLibraryByUserId(realm, settings)
145+
realm.copyFromRealm(results)
148146
}
149147

150148
view.findViewById<FlexboxLayout>(R.id.flexboxLayout).flexDirection = FlexDirection.ROW

0 commit comments

Comments
 (0)