@@ -6,13 +6,12 @@ import android.view.View
6
6
import androidx.appcompat.content.res.AppCompatResources
7
7
import androidx.core.view.isVisible
8
8
import androidx.fragment.app.viewModels
9
- import androidx.navigation.fragment.findNavController
10
9
import androidx.recyclerview.widget.LinearLayoutManager
11
10
import com.woocommerce.android.AppUrls
12
- import com.woocommerce.android.AppUrls.FETCH_PAYMENT_METHOD_URL_PATH
13
- import com.woocommerce.android.NavGraphOrdersDirections
11
+ import com.woocommerce.android.NavGraphMainDirections
14
12
import com.woocommerce.android.R
15
13
import com.woocommerce.android.databinding.FragmentEditShippingLabelPaymentBinding
14
+ import com.woocommerce.android.extensions.findNavController
16
15
import com.woocommerce.android.extensions.handleNotice
17
16
import com.woocommerce.android.extensions.navigateBackWithNotice
18
17
import com.woocommerce.android.extensions.navigateBackWithResult
@@ -198,10 +197,10 @@ class EditShippingLabelPaymentFragment :
198
197
viewModel.event.observe(viewLifecycleOwner) { event ->
199
198
when (event) {
200
199
is AddPaymentMethod -> {
201
- findNavController().navigateSafely(
202
- NavGraphOrdersDirections .actionGlobalAuthenticatedWebViewFragment(
200
+ findNavController(R .id.nav_host_fragment_main ).navigateSafely(
201
+ NavGraphMainDirections .actionGlobalAuthenticatedWebViewFragment(
203
202
urlToLoad = AppUrls .WPCOM_ADD_PAYMENT_METHOD ,
204
- urlsToTriggerExit = arrayOf(FETCH_PAYMENT_METHOD_URL_PATH ),
203
+ urlsToTriggerExit = arrayOf(AppUrls . FETCH_PAYMENT_METHOD_URL_PATH ),
205
204
title = getFragmentTitle()
206
205
)
207
206
)
@@ -215,7 +214,7 @@ class EditShippingLabelPaymentFragment :
215
214
}
216
215
217
216
private fun setupResultHandlers () {
218
- handleNotice(AuthenticatedWebViewFragment .WEBVIEW_RESULT ) {
217
+ handleNotice(AuthenticatedWebViewFragment .WEBVIEW_RESULT , navHostId = R .id.nav_host_fragment_main ) {
219
218
viewModel.onPaymentMethodAdded()
220
219
}
221
220
}
0 commit comments