Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
fix: My Courses screen detached fragment issue for ViewModel
Browse files Browse the repository at this point in the history
- App crashes when the learner receives a delayed response from
  Firebase Remote Config on a detached 'MyCourseListFragment' and
  tries to initialize the viewModel on it. We will restrict the app
  from initializing ViewModel on a detached fragment to fix this
  issue.

Fixes: LEARNER-8986
  • Loading branch information
HamzaIsrar12 authored and omerhabib26 committed Aug 18, 2022
1 parent fd21986 commit 2c494a0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class MyCoursesListFragment : OfflineSupportBaseFragment(), RefreshListener {
}

private fun initInAppPurchaseSetup() {
if (environment.remoteFeaturePrefs.isValuePropEnabled()) {
if (isAdded && environment.remoteFeaturePrefs.isValuePropEnabled()) {
initFullscreenLoader()
initObservers()
}
Expand Down

0 comments on commit 2c494a0

Please sign in to comment.