😴 Minor improvements

This commit is contained in:
2018-06-13 19:48:00 +02:00
parent 76317a2488
commit 8b89d81970
3 changed files with 7 additions and 6 deletions

View File

@ -262,10 +262,11 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
}
private fun connectivityChangeListener() =
OnPreferenceChangeListener { preference, newValue ->
val ctx = context
if (ctx != null && Build.VERSION.SDK_INT >= LOLLIPOP && Preferences.isFullNodeActive(ctx)) {
NetworkUtils.scheduleNodeStart(ctx)
OnPreferenceChangeListener { _, _ ->
context?.let { ctx ->
if (Build.VERSION.SDK_INT >= LOLLIPOP && Preferences.isFullNodeActive(ctx)) {
NetworkUtils.scheduleNodeStart(ctx)
}
}
true
}