fix: lifecycleScope of the coroutine
Description
This MR should fix the crash reported in sentry. Here, We have fixed a lifecycle-related issue.
Screenshots
Technical details
ApplicationFragment used lifecyclescope instead of lifecyclescope of viewLifecycleowner. Here, the fragment's lifecycle is bigger than the view's lifecycle when the view may not be available. In this situation, If user moves to another fragment, there is a chance that the view can be accessed when the view is already destroyed.
So, we have used the lifecycle scope of viewLifecycleOwner so that the view can only be accessed when it is available. We have fixed same type of usage in other fragments as well.
Tests
Issues
10 commandments of code reviews
Summary by CodeRabbit
-
Bug Fixes
- Enhanced lifecycle management of coroutines across multiple fragments to prevent potential memory leaks.
- Updated coroutine launch contexts to align with the view's lifecycle, improving application robustness.
These changes ensure smoother performance and reliability when interacting with the app, particularly during view transitions.