diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt index 8a9c68fcb..619cc9478 100644 --- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt +++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt @@ -198,17 +198,6 @@ abstract class BaseBrowserFragment : MediaBrowserFragment(), IRefr } isRootDirectory = defineIsRoot() browserFavRepository = BrowserFavRepository.getInstance(requireContext()) - lifecycleScope.launch(Dispatchers.Main) { - viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { - needRefresh.observe(this@BaseBrowserFragment) { - - if (it) { - viewModel.refreshMW() - needRefresh.postValue(false) - } - } - } - } } private fun manageDisplay() { @@ -288,6 +277,17 @@ abstract class BaseBrowserFragment : MediaBrowserFragment(), IRefr } inCards = Settings.getInstance(requireActivity()).getBoolean(BROWSER_DISPLAY_IN_CARDS, false) + lifecycleScope.launch(Dispatchers.Main) { + viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { + needRefresh.observe(viewLifecycleOwner) { + + if (it) { + viewModel.refreshMW() + needRefresh.postValue(false) + } + } + } + } } override fun onDisplaySettingChanged(key: String, value: Any) {