|
|
@ -14,6 +14,7 @@ import androidx.lifecycle.lifecycleScope
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
|
|
|
|
import mozilla.components.lib.state.ext.consumeFrom
|
|
|
|
import mozilla.components.lib.state.ext.observeAsComposableState
|
|
|
|
import mozilla.components.lib.state.ext.observeAsComposableState
|
|
|
|
import org.mozilla.fenix.components.StoreProvider
|
|
|
|
import org.mozilla.fenix.components.StoreProvider
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
@ -66,6 +67,15 @@ class AddressManagementFragment : Fragment() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
|
|
|
|
|
|
consumeFrom(store) { state ->
|
|
|
|
|
|
|
|
if (!state.isLoading && state.addresses.isEmpty()) {
|
|
|
|
|
|
|
|
findNavController().popBackStack()
|
|
|
|
|
|
|
|
return@consumeFrom
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Fetches all the addresses from the autofill storage and updates the
|
|
|
|
* Fetches all the addresses from the autofill storage and updates the
|
|
|
|
* [AutofillFragmentStore] with the list of addresses.
|
|
|
|
* [AutofillFragmentStore] with the list of addresses.
|
|
|
|