Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5c233fd authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Merge branch '0-fix_sentry_issues' into 'main'

0 fix sentry issues

See merge request !180
parents 35ffad81 72dc7173
Loading
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 MURENA SAS
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package foundation.e.advancedprivacy.common.extensions

import android.os.Bundle
import androidx.navigation.NavController
import androidx.navigation.NavDirections

fun NavController.safeNavigate(direction: NavDirections) {
    currentDestination?.getAction(direction.actionId)?.run {
        navigate(direction.actionId)
    }
}

fun NavController.safeNavigateWithArgs(direction: NavDirections, bundle: Bundle?) {
    currentDestination?.getAction(direction.actionId)?.run {
        navigate(direction.actionId, bundle)
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import com.google.android.material.tabs.TabLayoutMediator
import foundation.e.advancedprivacy.R
import foundation.e.advancedprivacy.common.BigNumberFormatter
import foundation.e.advancedprivacy.common.NavToolbarFragment
import foundation.e.advancedprivacy.common.extensions.safeNavigate
import foundation.e.advancedprivacy.databinding.FragmentDashboardBinding
import foundation.e.advancedprivacy.domain.entities.FeatureMode
import foundation.e.advancedprivacy.domain.entities.FeatureState
@@ -171,7 +172,7 @@ class DashboardFragment : NavToolbarFragment(R.layout.fragment_dashboard) {

        viewLifecycleOwner.lifecycleScope.launch {
            viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
                viewModel.navigate.collect(findNavController()::navigate)
                viewModel.navigate.collect(findNavController()::safeNavigate)
            }
        }

+2 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.google.android.material.tabs.TabLayoutMediator
import foundation.e.advancedprivacy.R
import foundation.e.advancedprivacy.common.NavToolbarFragment
import foundation.e.advancedprivacy.common.extensions.findViewHolderForAdapterPosition
import foundation.e.advancedprivacy.common.extensions.safeNavigate
import foundation.e.advancedprivacy.common.extensions.updatePagerHeightForChild
import foundation.e.advancedprivacy.databinding.FragmentTrackersBinding
import kotlinx.coroutines.flow.SharedFlow
@@ -100,7 +101,7 @@ class TrackersFragment : NavToolbarFragment(R.layout.fragment_trackers) {

            lifecycleScope.launch {
                repeatOnLifecycle(Lifecycle.State.STARTED) {
                    viewModel.navigate.collect(findNavController()::navigate)
                    viewModel.navigate.collect(findNavController()::safeNavigate)
                }
            }
        }
+2 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayoutMediator
import foundation.e.advancedprivacy.R
import foundation.e.advancedprivacy.common.extensions.findViewHolderForAdapterPosition
import foundation.e.advancedprivacy.common.extensions.safeNavigate
import foundation.e.advancedprivacy.common.extensions.updatePagerHeightForChild
import foundation.e.advancedprivacy.databinding.TrackersPeriodFragmentBinding
import foundation.e.advancedprivacy.features.trackers.TrackersPeriodViewModel.SingleEvent
@@ -147,7 +148,7 @@ class TrackersPeriodFragment : Fragment(R.layout.trackers_period_fragment) {

            lifecycleScope.launch {
                repeatOnLifecycle(Lifecycle.State.STARTED) {
                    viewModel.navigate.collect(findNavController()::navigate)
                    viewModel.navigate.collect(findNavController()::safeNavigate)
                }
            }

+3 −0
Original line number Diff line number Diff line
@@ -122,6 +122,9 @@ interface IPermissionsPrivacyModule {
     */
    fun getAlwaysOnVpnPackage(): String?

    /** Returns the dummy package name used by Android to highlight legacy VPN */
    fun getLegacyVpnDummyPackage(): String

    /**
     * Allows users to block notifications sent through this channel, if this channel belongs to
     * a package that is signed with the system signature.
Loading