Improved code readablity

This commit is contained in:
litetex 2021-11-02 23:22:52 +01:00
parent 58418bcf46
commit 0f4b6d7d9f

View file

@ -47,6 +47,7 @@ class NotificationsSettingsFragment : BasePreferenceFragment(), OnSharedPreferen
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
val enabled = NotificationHelper.areNotificationsEnabledOnDevice(requireContext()) val enabled = NotificationHelper.areNotificationsEnabledOnDevice(requireContext())
preferenceScreen.isEnabled = enabled preferenceScreen.isEnabled = enabled
if (!enabled) { if (!enabled) {
@ -73,6 +74,8 @@ class NotificationsSettingsFragment : BasePreferenceFragment(), OnSharedPreferen
notificationWarningSnackbar?.dismiss() notificationWarningSnackbar?.dismiss()
notificationWarningSnackbar = null notificationWarningSnackbar = null
} }
// (Re-)Create loader
loader?.dispose() loader?.dispose()
loader = SubscriptionManager(requireContext()) loader = SubscriptionManager(requireContext())
.subscriptions() .subscriptions()
@ -83,6 +86,7 @@ class NotificationsSettingsFragment : BasePreferenceFragment(), OnSharedPreferen
override fun onPause() { override fun onPause() {
loader?.dispose() loader?.dispose()
loader = null loader = null
super.onPause() super.onPause()
} }