[fenix] For https://github.com/mozilla-mobile/fenix/issues/16442 - Check if fragment is still attached before updating site permissions rules (https://github.com/mozilla-mobile/fenix/pull/16954)

pull/600/head
ekager 4 years ago committed by GitHub
parent 6210ff136d
commit 361b86b5e6

@ -86,6 +86,7 @@ import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.IntentReceiverActivity
import org.mozilla.fenix.NavGraphDirections
import org.mozilla.fenix.OnBackLongPressedListener
import org.mozilla.fenix.addons.runIfFragmentIsAttached
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.browser.readermode.DefaultReaderModeController
@ -636,7 +637,9 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler,
context.settings().setSitePermissionSettingListener(viewLifecycleOwner) {
// If the user connects to WIFI while on the BrowserFragment, this will update the
// SitePermissionsRules (specifically autoplay) accordingly
assignSitePermissionsRules()
runIfFragmentIsAttached {
assignSitePermissionsRules()
}
}
assignSitePermissionsRules()

Loading…
Cancel
Save