Skip to content

Commit

Permalink
courses: smoother joining (fixes #5109) (#5110)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Jan 24, 2025
1 parent ee76309 commit 1d5211f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2237
versionName "0.22.37"
versionCode 2238
versionName "0.22.38"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@ class TakeCourseFragment : Fragment(), ViewPager.OnPageChangeListener, View.OnCl
fragmentTakeCourseBinding.btnRemove.visibility = View.GONE
}
}

val detachedUserModel = userModel?.let { mRealm.copyFromRealm(it) }
val detachedCurrentCourse = currentCourse?.let { mRealm.copyFromRealm(it) }

withContext(Dispatchers.IO) {
try {
Realm.getDefaultInstance().use { backgroundRealm ->
createActivity(backgroundRealm, userModel?.let { backgroundRealm.copyFromRealm(it) }, currentCourse?.let { backgroundRealm.copyFromRealm(it) })
createActivity(backgroundRealm, detachedUserModel, detachedCurrentCourse)
}
} catch (e: Exception) {
e.printStackTrace()
Expand Down

0 comments on commit 1d5211f

Please sign in to comment.