1
0
Fork 0

Closes #4265 - Do not pop after all exceptions are removed (#4392)

master
Emily Kager 2019-07-31 14:43:15 -04:00 committed by Jeff Boek
parent c632c9920c
commit 95208c84a9
3 changed files with 3 additions and 10 deletions

View File

@ -11,7 +11,6 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.navigation.Navigation
import kotlinx.android.synthetic.main.fragment_exceptions.view.*
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main
@ -65,9 +64,7 @@ class ExceptionsFragment : Fragment() {
viewLifecycleOwner.lifecycleScope.launch(IO) {
val domains = ExceptionDomains.load(context!!)
ExceptionDomains.remove(context!!, domains)
launch(Main) {
view?.let { view -> Navigation.findNavController(view).navigateUp() }
}
reloadData()
}
}
@ -101,10 +98,6 @@ class ExceptionsFragment : Fragment() {
coroutineScope {
launch(Main) {
if (items.isEmpty()) {
view?.let { view: View -> Navigation.findNavController(view).navigateUp() }
return@launch
}
exceptionsStore.dispatch(ExceptionsAction.Change(items))
}
}

View File

@ -55,7 +55,7 @@
android:title="@string/preferences_category_privacy"
app:iconSpaceReserved="false">
<androidx.preference.Preference
android:icon="@drawable/ic_tracking_protection"
android:icon="@drawable/ic_tracking_protection_enabled"
android:key="@string/pref_key_tracking_protection_settings"
android:title="@string/preferences_tracking_protection" />
<androidx.preference.Preference

View File

@ -5,7 +5,7 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_tracking_protection"
android:icon="@drawable/ic_tracking_protection_enabled"
android:key="@string/pref_key_tracking_protection"
android:summary="@string/preferences_tracking_protection_description"
android:title="@string/preferences_tracking_protection" />