[fenix] For https://github.com/mozilla-mobile/fenix/issues/25505: Clear the stored result in case there is no listener with the same key set.

This is the case when the sharing happens outside the tabs tray.
pull/600/head
mcarare 2 years ago committed by mergify[bot]
parent a2c1380504
commit 24e65e06d0

@ -10,6 +10,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.fragment.app.clearFragmentResult
import androidx.fragment.app.setFragmentResult
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory
@ -128,6 +129,8 @@ class ShareFragment : AppCompatDialogFragment() {
override fun onDestroy() {
setFragmentResult(RESULT_KEY, Bundle())
// Clear the stored result in case there is no listener with the same key set.
clearFragmentResult(RESULT_KEY)
super.onDestroy()
}

Loading…
Cancel
Save