Skip to content

Commit

Permalink
fix: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
PouriaAmini committed Aug 15, 2024
1 parent f818439 commit 4097ab7
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ internal object FragmentActivityHandler {
}

fun Activity.unregisterFragmentLifecycleCallbacks() {
(this as? FragmentActivity)?.let { fragmentActivity ->
callbacksMap.remove(fragmentActivity)?.forEach {
fragmentActivity.supportFragmentManager.unregisterFragmentLifecycleCallbacks(it)
(this as? FragmentActivity)?.apply {
callbacksMap.remove(this)?.let { callbacks ->
for (callback in callbacks) {
supportFragmentManager.unregisterFragmentLifecycleCallbacks(callback)
}
}
}
}
Expand Down

0 comments on commit 4097ab7

Please sign in to comment.