1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 20:42:34 +01:00

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