@@ -102,7 +102,7 @@ class ThreadListFragment : TwoPaneFragment(), SwipeRefreshLayout.OnRefreshListen
102102
103103 private val showLoadingTimer: CountDownTimer by lazy { Utils .createRefreshTimer(onTimerFinish = ::showRefreshLayout) }
104104
105- private var canRefreshThreads = false
105+ private var isFirstTimeRefreshingThreads = true
106106
107107 @Inject
108108 lateinit var localSettings: LocalSettings
@@ -234,16 +234,20 @@ class ThreadListFragment : TwoPaneFragment(), SwipeRefreshLayout.OnRefreshListen
234234 super .onResume()
235235 refreshThreadsIfNotificationsAreDisabled()
236236 updateSwipeActionsAccordingToSettings()
237- canRefreshThreads = true
238237 }
239238
240239 private fun refreshThreadsIfNotificationsAreDisabled () = with (mainViewModel) {
241- val areGoogleServicesDisabled = ! playServicesUtils.areGooglePlayServicesAvailable()
242- val areAppNotifsDisabled = ! notificationManagerCompat.areNotificationsEnabled()
243- val areMailboxNotifsDisabled = currentMailbox.value?.notificationsIsDisabled(notificationManagerCompat) == true
244- val shouldRefreshThreads = areGoogleServicesDisabled || areAppNotifsDisabled || areMailboxNotifsDisabled
245240
246- if (shouldRefreshThreads && canRefreshThreads) forceRefreshThreads()
241+ if (! isFirstTimeRefreshingThreads) {
242+ val areGoogleServicesDisabled = ! playServicesUtils.areGooglePlayServicesAvailable()
243+ val areAppNotifsDisabled = ! notificationManagerCompat.areNotificationsEnabled()
244+ val areMailboxNotifsDisabled = currentMailbox.value?.notificationsIsDisabled(notificationManagerCompat) == true
245+ val shouldRefreshThreads = areGoogleServicesDisabled || areAppNotifsDisabled || areMailboxNotifsDisabled
246+
247+ if (shouldRefreshThreads) forceRefreshThreads()
248+ }
249+
250+ isFirstTimeRefreshingThreads = false
247251 }
248252
249253 private fun updateSwipeActionsAccordingToSettings () = with (binding.threadsList) {
0 commit comments